| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Before this change, when there were import failures by Astroid, it
would store the error in the module cache (for example a "module not
found" error), including tracebacks. These tracebacks would take up a
lot of memory, and don't seem to be used for any sort of purpose
beyond debugging value.
On one project stripping this value entirely reduces memory usage by
75%.
|
| |
|
|
|
| |
Close #725
|
| |
|
|
|
| |
When profiling locally, approximately 7% of a full pylint run is spent in `os.getcwd`, despite its value effectively not being used if `context_file` is `None`. A quick grep over this project and others seem to indicate that `context_file` is rarely used, so this should almost entirely get rid of this system call.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently the astroid bootstrapping function, which builds the builtins
module and relevant builtin objects, does not rebuild objects such as
generators. This is causing a problem when the cache is cleared, e.g.
from pylint's side, given that objects such as generator will not be
present any longer in the builtins module created *after* the cache was
cleared with MANAGER.cache_clear(). This behaviour was making that function
useless from this point of view.
The new change instead makes sure to build everything in the same
function.
Close #446
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
This would introduce a new method of configuring astroid & pylint, while the
usual approach we used so far was to set a flag in the MANAGER itself it we'd
need to customize some behaviour (extension_package_whitelist and friends).
Also renamed the flag to `max_inferable_values` to be more suggestive on what it does.
|
|
|
|
|
|
|
|
|
|
| |
spot performance issues.
Add new envrionment variable call ASTROID_MAX_INFERABLE to tune
the max inferable amount of values at a time.
Close #579
Close PyCQA/pylint#2251
|
|
|
| |
See https://github.com/PyCQA/pylint/pull/2209
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Removes an abundance of useless-supression errors
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
multiple directories contributing to the same namespace.
|
| |
|
|
|
|
| |
The first name will exist until astroid 2.0.
|
|
|
|
|
|
|
|
| |
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.
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
|\ \
| |/ |
|