summaryrefslogtreecommitdiff
path: root/astroid/manager.py
Commit message (Collapse)AuthorAgeFilesLines
* AstroidBuildingException is now AstroidBuildingError.Claudiu Popa2015-12-061-9/+9
| | | | The first name will exist until astroid 2.0.
* Add two new exceptions, AstroidImportError and AstroidSyntaxError.Claudiu Popa2015-12-061-6/+6
| | | | | | | | They are subclasses of AstroidBuildingException and are raised when a module can't be imported from various reasons. Also do_import_module lets the errors to bubble up without converting them to InferenceError. This particular conversion happens only during the inference.
* Merge upstream changesCeridwen2015-11-061-21/+28
|\
| * Rename Uninferable and instatiate_classCeridwen2015-11-061-1/+1
| |
| * This bookmark adds structured exceptions to astroid.Ceridwen2015-11-021-21/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Major changes: * AstroidError has an __init__ that accepts arbitrary keyword-only arguments for adding information to exceptions, and a __str__ that lazily uses exception attributes to generate a message. The first positional argument to an exception is assigned to .message. The new API should be fully backwards compatible in general. * Some exceptions are combined or renamed; the old names are still available. * The OperationErrors used by pylint are now BadOperationMessages and located in util.py. * The AstroidBuildingException in _data_build stores the SyntaxError in its .error attribute rather than args[0]. * Many places where exceptions are raised have new, hopefully more useful error messages. The only major issue remaining is how to propagate information into decorators.
* | Rename Uninferable and instantiate_class, fix broken tests, improveCeridwen2015-11-061-1/+1
|/ | | | | | | | | | | testing. * Rename YES to Uninferable * Rename instanciate_class to instantiate_class. * Use six in test_namedtuple_advanced_inference. * Fix test_file_from_module failure on PyPy. * Add enum34 to unittest_brain. * Add unittest_brain dependencies tox.ini.
* Remove doctype and future imports which aren't useful.Claudiu Popa2015-10-111-1/+0
|
* Fix pylint errors.Claudiu Popa2015-09-261-3/+3
|
* Add helper function for reraising exceptionsCeridwen2015-09-211-18/+7
|
* Use six.reraise to avoid losing tracebacks for simple casesCeridwen2015-09-211-7/+26
|
* Add deprecation warnings testsCeridwen2015-08-221-1/+0
|
* Merge main into defaultCeridwen2015-08-141-64/+36
|\
| * Big cleanup across the entire projectClaudiu Popa2015-08-121-23/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The cleanup consisted in a couple of changes: * import only modules, not objects, in order to not clutter the module namespace and to not leak accidentally objects which aren't public API for the said modules. * use two spaces between module level functions * move some mixins from astroid.node_classes in the proper order, starting at the left, not being last in the MRO.
| * Fix pylint warnings.Claudiu Popa2015-08-021-2/+0
| |
| * There's a new separate step for transforms.Claudiu Popa2015-08-021-39/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Until now, the transforms were applied at the same time the tree was being built. This was problematic if the transform functions were using inference, since the inference was executed on a partially constructed tree, which led to failures when post-building information was needed (such as setting the _from_names for the From imports). Now there's a separate step for transforms, which are applied using transform.TransformVisitor. There's a couple of other related changes: * astroid.parse and AstroidBuilder gained a new parameter `apply_transforms`, which is a boolean flag, which will control if the transforms are applied. We do this because there are uses when the vanilla tree is wanted, without any implicit modification. * the transforms are also applied for builtin modules, as a side effect of the fact that transform visiting was moved in AstroidBuilder._post_build from AstroidBuilder._data_build. Closes issue #116.
| * Remove the useless __docformat__ variable.Claudiu Popa2015-07-231-2/+0
| |
* | Merged changes from logilab/astroidCeridwen2015-07-101-6/+4
|\ \ | |/ |/|
| * Refactor node classes to have constructors and change some names.Ceridwen2015-07-101-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I corrected the spelling of 'infered' to 'infered' and changed some to make them more consistent with the built-in ast module and to read better in English. I created aliases with proxy objects to maintain backwards compatibility. I also refactored the node classes so that they have __init__ and postinit functions. The postinit function has to be called after the creation of a parent with the instances of its children because the node __init__ functions have to take a parent instance to maintain the doubly-linked structure of the AST. This involved moving considerable amounts of node-construction logic from rebuilder.py to node_classes.py and scoped_nodes.py.
| * Node constructors almost finished except for two bugsCeridwen2015-07-081-4/+4
| |
* | Move pyreverse specific modules and functionality back into pyreverseClaudiu Popa2015-07-031-99/+5
|/ | | | | We moved astroid.manager.Project and astroid.manager.Manager.project_from_files to pyreverse.inspector.
* Fix pylint warnings over astroid, update the list of disabled messages in ↵Claudiu Popa2015-05-191-3/+3
| | | | pylintrc.
* Add a new option to AstroidManager for controlling the AST peephole optimizerClaudiu Popa2015-03-141-0/+1
| | | | | | | The new option, 'optimize_ast', controls if peephole optimizer should be enabled or not. This prevents a regression, where the visit_binop method wasn't called anymore with astroid 1.3.5, due to the differences in the resulting AST. Closes issue #82.
* Remove the trailing whitespace.Claudiu Popa2015-01-151-1/+1
|
* Fix the test's astroid cache problem.Claudiu Popa2015-01-151-3/+4
| | | | | | | | | | | | | | | | | | There were two problems until now: * first, the transformed builtin object was deleting during clear_cache, leaving the next tests to use the untransformed tests, which yielded InferenceErrors. * after the first problem was fixed, another problem with CONST_PROXY occurred, since it was creating a new builtins object, without the builtins transformations applied, which was used for creating the const classes. The problem was that even replacing the builtins instance in astroid_cache, InferenceErrors occurred, because the const classes were already built and they were referencing the untransformed builtins. That's why _astroid_bootstrapping allows to receive a new builtins object, which is passed properly by the tests.
* Remove all trailing whitespaces.Claudiu Popa2015-01-101-1/+1
|
* Remove superfluous quotation mark in docstringBioGeek/remove-superfluous-quotation-mark-in-doc-1418828415832BioGeek2014-12-171-1/+1
|
* Add support for more fine-grained control over extension loading.Torsten Marek2014-11-221-1/+13
|
* add XXX noteSylvain Th?nault2014-11-191-0/+1
|
* Generalize hooks for resolving imports that cannot be resolved normally,Torsten Marek2014-11-151-0/+18
| | | | and use the functionality in brain/py2gi.
* Simplify & generalize code for module extenders.Torsten Marek2014-11-151-3/+4
|
* Fix zip_import_data for Windows.Claudiu Popa2014-11-141-2/+2
|
* Explicitly raise if filepath is None in ast_from_module_name.Torsten Marek2014-11-091-0/+2
|
* Never load C extensions that are not from the standard library and also ↵Torsten Marek2014-11-091-18/+25
| | | | | | never load any compiled Python files. Fixes pylint issue #347.
* Move all astroid modules into a its own directory, which is now the package.Torsten Marek2014-11-081-0/+348
python setup.py develop now works.