- Update to Version 2.12.8
* Fixed a crash in the ``dataclass`` brain for ``InitVars`` without subscript typing.
Closes PyCQA/pylint#7422
* Fixed parsing of default values in ``dataclass`` attributes.
Closes PyCQA/pylint#7425
- Update to Version 2.12.7
* Fixed a crash in the ``dataclass`` brain for uninferable bases.
Closes PyCQA/pylint#7418
- Update to Version 2.12.6
* Fix a crash involving ``Uninferable`` arguments to ``namedtuple()``.
Closes PyCQA/pylint#7375
* The ``dataclass`` brain now understands the ``kw_only`` keyword in dataclass decorators.
Closes PyCQA/pylint#7290
- Update to Version 2.12.5
* Prevent first-party imports from being resolved to `site-packages`.
Refs PyCQA/pylint#7365
* Fix ``astroid.interpreter._import.util.is_namespace()`` incorrectly
returning ``True`` for frozen stdlib modules on PyPy.
Closes#1755
OBS-URL: https://build.opensuse.org/request/show/1005503
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-astroid?expand=0&rev=71
* Fixed regression where packages without a ``__init__.py`` file were
not recognized or imported correctly.
* Fixed regression in ``astroid.scoped_nodes`` where ``_is_metaclass``
was not accessible anymore.
* ``NodeNG.frame()`` and ``NodeNG.statement()`` will start raising ``ParentMissingError``
instead of ``AttributeError`` in astroid 3.0. This behaviour can already be triggered
by passing ``future=True`` to a ``frame()`` or ``statement()`` call.
* Prefer the module loader get_source() method in AstroidBuilder's
module_build() when possible to avoid assumptions about source
code being available on a filesystem. Otherwise the source cannot
be found and application behavior changes when running within an
embedded hermetic interpreter environment (pyoxidizer, etc.).
* Require Python 3.6.2 to use astroid.
* Removed custom ``distutils`` handling for resolving paths to submodules.
* Fix ``deque.insert()`` signature in ``collections`` brain.
* Fix ``Module`` nodes not having a ``col_offset``, ``end_lineno``, and ``end_col_offset``
attributes.
* Fix typing and update explanation for ``Arguments.args`` being ``None``.
* Fix crash if a variable named ``type`` is subscripted in a generator expression.
* Enable inference of dataclass import from marshmallow_dataclass.
This allows the dataclasses brain to recognize dataclasses annotated by marshmallow_dataclass.
* Resolve symlinks in the import path
Fixes inference error when the import path includes symlinks (e.g. Python
installed on macOS via Homebrew).
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-astroid?expand=0&rev=68
* Use more permissive versions for the ``typed-ast`` dependencie
(<2.0 instead of <1.5)
* Fix crash on inference of ``__len__``.
* Added missing ``kind`` (for ``Const``) and ``conversion``
(for ``FormattedValue``) fields to repr.
* Fix crash with assignment expressions, nested if expressions
and filtering of statements
* Fix incorrect filtering of assignment expressions statements
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-astroid?expand=0&rev=66
- Update to 2.8.4
* Fix the ``scope()`` and ``frame()`` methods of ``NamedExpr``
nodes. When these nodes occur in ``Arguments``, ``Keyword`` or
``Comprehension`` nodes these methods now correctly point to
the outer-scope of the ``FunctionDef``, ``ClassDef``, or
``Comprehension``.
* Fix the ``set_local`` function for ``NamedExpr`` nodes. When
these nodes occur in ``Arguments``, ``Keyword``, or
``Comprehension`` nodes these nodes are now correctly added to
the locals of the ``FunctionDef``, ``ClassDef``, or
``Comprehension``.
- Release 2.8.3?
* Add support for wrapt 1.13
* Fixes handling of nested partial functions
* Fix regression with the import resolver
* Fix crash with invalid dataclass field call
- Release 2.8.1
* Adds support of type hints inside numpy's brains.
* Enable inference of dataclass import from pydantic.dataclasses.
This allows the dataclasses brain to recognize pydantic
dataclasses.
* Fix regression on ClassDef inference
* Fix regression on Compare node inference
* Extended attrs brain to support the provisional APIs
* Astroid does not trigger it's own deprecation warning anymore.
* Improve brain for ``typing.Callable`` and ``typing.Type``.
* Fix bug with importing namespace packages with relative imports
* The ``is_typing_guard`` and ``is_sys_guard`` functions are
deprecated and will be removed in 3.0.0. They are complex
meta-inference functions that are better suited for pylint.
OBS-URL: https://build.opensuse.org/request/show/927778
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-astroid?expand=0&rev=65
- Update to 2.8.0
* Add additional deprecation warnings in preparation for astroid
3.0
* Require attributes for some node classes with ``__init__``
call.
* ``name`` (``str``) for ``Name``, ``AssignName``,
``DelName``
* ``attrname`` (``str``) for ``Attribute``, ``AssignAttr``,
``DelAttr``
* ``op`` (``str``) for ``AugAssign``, ``BinOp``, ``BoolOp``,
``UnaryOp``
* ``names`` (``list[tuple[str, str | None]]``) for ``Import``
* Support pyz imports
* Add ``node_ancestors`` method to ``NodeNG`` for obtaining the
ancestors of nodes.
* It's now possible to infer the value of comparison nodes
* Fixed bug in inference of dataclass field calls.
- Release 2.7.3
* The transforms related to a module are applied only if this
module has not been explicitly authorized to be imported
(i.e is not in AstroidManager.extension_package_whitelist).
Solves the following issues if numpy is authorized to be
imported through the `extension-pkg-allow-list` option.
* Fixed bug in attribute inference from inside method calls.
* Fixed bug in inference for superclass instance methods called
from the class rather than an instance.
* Fixed bug in inference of chained attributes where a subclass
had an attribute that was an instance of its superclass.
* Adds a brain for the ctypes module.
* When processing dataclass attributes, exclude the same type
OBS-URL: https://build.opensuse.org/request/show/922892
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-astroid?expand=0&rev=64
- Update to 2.7.1
* When processing dataclass attributes, only do typing inference on collection types.
Support for instantiating other typing types is left for the future, if desired.
Closes#1129
* Fixed LookupMixIn missing from ``astroid.node_classes``.
- from version 2.7.0
* Import from ``astroid.node_classes`` and ``astroid.scoped_nodes`` has been deprecated in favor of
``astroid.nodes``. Only the imports from ``astroid.nodes`` will work in astroid 3.0.0.
* Add support for arbitrary Enum subclass hierachies
ClosesPyCQA/pylint#533ClosesPyCQA/pylint#2224ClosesPyCQA/pylint#2626
* Add inference tips for dataclass attributes, including dataclasses.field calls.
Also add support for InitVar.
ClosesPyCQA/pylint#2600ClosesPyCQA/pylint#2698ClosesPyCQA/pylint#3405ClosesPyCQA/pylint#3794
* Adds a brain that deals with dynamic import of `IsolatedAsyncioTestCase` class of the `unittest` module.
ClosesPyCQA/pylint#4060
- from version 2.6.6
* Added support to infer return type of ``typing.cast()``
* Fix variable lookup's handling of exclusive statements
ClosesPyCQA/pylint#3711
* Fix variable lookup's handling of function parameters
ClosesPyCQA/astroid#180
* Fix variable lookup's handling of except clause variables
* Fix handling of classes with duplicated bases with the same name
ClosesPyCQA/astroid#1088
- from version 2.6.5
OBS-URL: https://build.opensuse.org/request/show/913116
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-astroid?expand=0&rev=62
- Update to 2.5.6
* Fix retro-compatibility issues with old version of pylint
ClosesPyCQA/pylint#4402
* Fixes the discord link in the project urls of the package.
ClosesPyCQA/pylint#4393
* The packaging is now done via setuptools exclusively.
doc, tests, and Changelog are not packaged anymore - reducing
the size of the package greatly.
* __pkginfo__ now only contain __version__ (also accessible with
astroid.__version__), other meta-information are still
accessible with import importlib;metadata.metadata('astroid').
* Added inference tip for typing.Tuple alias
* Fix crash when evaluating typing.NamedTuple
ClosesPyCQA/pylint#4383
* COPYING was removed in favor of COPYING.LESSER and the latter
was renamed to LICENSE to make more apparent that the code is
licensed under LGPLv2 or later.
* Takes into account the fact that subscript inferring for a
ClassDef may involve class_getitem method
* Reworks the collections and typing brain so that pylint`s
acceptance tests are fine.
ClosesPyCQA/pylint#4206
* Use inference_tip for typing.TypedDict brain.
* Fix mro for classes that inherit from typing.Generic
* Add inference tip for typing.Generic and typing.Annotated with
__class_getitem__
ClosesPyCQA/pylint#2822
* Detects import numpy as a valid numpy import.
ClosesPyCQA/pylint#3974
* Iterate over Keywords when using ClassDef.get_children
OBS-URL: https://build.opensuse.org/request/show/891337
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-astroid?expand=0&rev=60
- Update to 2.5.1
* The context.path is reverted to a set because otherwise it
leads to false positives for non `numpy` functions.
* Don't transform dataclass ClassVars
* Improve typing.TypedDict inference
* Fix the `Duplicates found in MROs` false positive.
- Release 2.5.0
* Adds `attr_fset` in the `PropertyModel` class.
* Remove support for Python 3.5.
* Remove the runtime dependency on six. The six brain
remains in astroid.
* Enrich the brain_collection module so that __class_getitem__
method is added to `deque` for
python version above 3.9.
* The context.path is now a dict and the context.push method
returns True if the node has been visited a certain amount of
times.
* Adds a brain for type object so that it is possible to write
`type[int]` in annotation.
* Add __class_getitem__ method to subprocess.Popen brain under
Python 3.9 so that it is seen as subscriptable by pylint.
* Adds `degrees`, `radians`, which are `numpy ufunc` functions,
in the `numpy` brain. Adds `random` function in the `numpy.
random` brain.
* Fix deprecated importlib methods
* Fix a crash in inference caused by `Uninferable` container
elements
* Add `python 3.9` support.
* The flat attribute of numpy.ndarray is now inferred as an
numpy.ndarray itself. It should be a numpy.flatiter instance,
but this class is not yet available in the numpy brain.
* Fix a bug for dunder methods inference of function objects
* Fixes a bug in the signature of the ndarray.__or__ method,
in the brain_numpy_ndarray.py module.
* Fixes a to-list cast bug in starred_assigned_stmts method,
in the protocols.py` module.
* Added a brain for hypothesis.strategies.composite
* The transpose of a numpy.ndarray is also a numpy.ndarray
* Added a brain for sqlalchemy.orm.session
* Separate string and bytes classes patching
* Prevent recursion error for self referential length calls
* Added missing methods to the brain for mechanize, to fix
pylint false positives
* Added more supported parameters to subprocess.check_output
* Fix recursion errors with pandas
* Added exception inference for `UnicodeDecodeError`
* `FunctionDef.is_generator` properly handles `yield` nodes in
`If` tests
* Fixed exception-chaining error messages.
* Fix failure to infer base class type with multiple inheritance
and qualified names
* Fix interpretation of six.with_metaclass class definitions.
* Reduce memory usage of astroid's module cache.
* Remove dependency on `imp`.
* Do not crash when encountering starred assignments in enums.
* Fix a crash in functools.partial inference when the arguments
cannot be determined
* Fix a crash caused by a lookup of a monkey-patched method
* is_generator correctly considers `Yield` nodes in `AugAssign`
nodes
This fixes a false positive with the
`assignment-from-no-return` pylint check.
* Corrected the parent of function type comment nodes.
These nodes used to be parented to their original ast.
FunctionDef parent but are now correctly parented to their
astroid.FunctionDef parent.
- Drop part_rm_dep_imp.patch fixed upstream
- Drop unpin-deps.patch unpinned upstream
OBS-URL: https://build.opensuse.org/request/show/880419
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-astroid?expand=0&rev=58
* Handle the case where the raw builder fails to retrieve the ``__all__`` attribute
* Restructure the AST parsing heuristic to always pick the same module
* Changed setup.py to work with [distlib](https://pypi.org/project/distlib)
* Do not crash with SyntaxError when parsing namedtuples with invalid label
* Protect against ``infer_call_result`` failing with `InferenceError` in `Super.getattr()`
* Expose a ast_from_string method in AstroidManager, which will accept
* ``BoundMethod.implicit_parameters`` returns a proper value for ``__new__``
* Allow slots added dynamically to a class to still be inferred
* Allow `FunctionDef.getattr` to look into both instance attrs and special attributes
* Infer qualified ``classmethod`` as a classmethod.
* Prevent a recursion error to happen when inferring the declared metaclass of a class
* Raise ``AttributeInferenceError`` when ``getattr()`` receives an empty name
* Prevent a recursion error for self reference variables and `type()` calls.
* Do not infer the first argument of a staticmethod in a metaclass as the class itself
* ``NodeNG.bool_value()`` gained an optional ``context`` parameter
* Pass a context argument to ``astroid.Arguments`` to prevent recursion errors
* Better inference of class and static methods decorated with custom methods
* Reverse the order of decorators for `infer_subscript`
* Prevent a recursion error when inferring self-referential variables without definition
* Numpy `datetime64.astype` return value is inferred as a `ndarray`.
* Skip non ``Assign`` and ``AnnAssign`` nodes from enum reinterpretation
* Numpy ``ndarray`` attributes ``imag`` and ``real`` are now inferred as ``ndarray``.
* Added a call to ``register_transform`` for all functions of the ``brain_numpy_core_multiarray``
* Use the parent of the node when inferring aug assign nodes instead of the statement
* Added some functions to the ``brain_numpy_core_umath`` module
* Added some functions of the ``numpy.core.multiarray`` module
* All the ``numpy ufunc`` functions derived now from a common class that
* ``nodes.Const.itered`` returns a list of ``Const`` nodes, not strings
* The ``shape`` attribute of a ``numpy ndarray`` is now a ``ndarray``
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-astroid?expand=0&rev=50
- Update to 1.3.6:
* Class.slots raises NotImplementedError for old style classes.
Closes issue #67.
* Add a new option to AstroidManager, `optimize_ast`, which
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.
* Add the ability to optimize small ast subtrees,
with the first use in the optimization of multiple
BinOp nodes. This removes recursivity in the rebuilder
when dealing with a lot of small strings joined by the
addition operator. Closes issue #59.
* Obtain the methods for the nose brain tip through an
unittest.TestCase instance. Closes Pylint issue #457.
* Fix a crash which occurred when a class was the ancestor
of itself. Closes issue #78.
* Improve the scope_lookup method for Classes regarding qualified
objects, with an attribute name exactly as one provided in the
class itself.
For example, a class containing an attribute 'first',
which was also an import and which had, as a base, a qualified name
or a Gettattr node, in the form 'module.first', then Pylint would
have inferred the `first` name as the function from the Class,
not the import. Closes Pylint issue #466.
* Implement the assigned_stmts operation for Starred nodes,
which was omitted when support for Python 3 was added in astroid.
Closes issue #36.
OBS-URL: https://build.opensuse.org/request/show/290986
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-astroid?expand=0&rev=16
- Update to 1.3.4:
* Get the first element from the method list when obtaining
the functions from nose.tools.trivial. Closes Pylint issue #448.
* Restore file_stream to a property, but deprecate it in favour of
the newly added method Module.stream. By using a method instead of a
property, it will be easier to properly close the file right
after it is used, which will ensure that no file descriptors are
leaked. Until now, due to the fact that a module was cached,
it was not possible to close the file_stream anywhere.
file_stream will start emitting PendingDeprecationWarnings in
astroid 1.4, DeprecationWarnings in astroid 1.5 and it will
be finally removed in astroid 1.6.
* Add inference tips for 'tuple', 'list', 'dict' and 'set' builtins.
* Add brain definition for most string and unicode methods
* Changed the API for Class.slots. It returns None when the class
doesn't define any slots. Previously, for both the cases where
the class didn't have slots defined and when it had an empty list
of slots, Class.slots returned an empty list.
* Add a new method to Class nodes, 'mro', for obtaining the
the method resolution order of the class.
* Add brain tips for six.moves. Closes issue #63.
* Improve the detection for functions decorated with decorators
which returns static or class methods.
* .slots() can contain unicode strings on Python 2.
* Add inference tips for nose.tools.
OBS-URL: https://build.opensuse.org/request/show/286631
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-astroid?expand=0&rev=14
- Update to 1.3.0:
* Fix a maximum recursion error occured during the inference,
where statements with the same name weren't filtered properly.
Closes pylint issue #295.
* Check that EmptyNode has an underlying object in
EmptyNode.has_underlying_object.
* Simplify the understanding of enum members.
* Fix an infinite loop with decorator call chain inference,
where the decorator returns itself. Closes issue #50.
* Various speed improvements. Patch by Alex Munroe.
* Add pytest brain plugin. Patch by Robbie Coomber.
* Support for Python versions < 2.7 has been dropped, and the
source has been made compatible with Python 2 and 3. Running
2to3 on installation for Python 3 is not needed anymore.
* astroid now depends on six.
* modutils._module_file opens __init__.py in binary mode.
Closes issues #51 and #13.
* Only C extensions from trusted sources (the standard library)
are loaded into the examining Python process to build an AST
from the live module.
* Path names on case-insensitive filesystems are now properly
handled. This fixes the stdlib detection code on Windows.
* Metaclass-generating functions like six.with_metaclass
are now supported via some explicit detection code.
* astroid.register_module_extender has been added to generalize
the support for module extenders as used by many brain plugins.
* brain plugins can now register hooks to handle failed imports,
as done by the gobject-introspection plugin.
* The modules have been moved to a separate package directory,
`setup.py develop` now works correctly.
OBS-URL: https://build.opensuse.org/request/show/262554
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-astroid?expand=0&rev=10
- Update to 1.2.1:
* Fix a crash occurred when inferring decorator call chain.
Closes issue #42.
* Set the parent of vararg and kwarg nodes when inferring them.
Closes issue #43.
* namedtuple inference knows about '_fields' attribute.
* enum members knows about the methods from the enum class.
* Name inference will lookup in the parent function
of the current scope, in case searching in the current scope
fails.
* Inference of the functional form of the enums takes into
consideration the various inputs that enums accepts.
* The inference engine handles binary operations (add, mul etc.)
between instances.
* Fix an infinite loop in the inference, by returning a copy
of instance attributes, when calling 'instance_attr'.
Closes issue #34 (patch by Emile Anclin).
* Don't crash when trying to infer unbound object.__new__ call.
Closes issue #11.
- Use upstream zip for packaging as .tar.gz is no longer provided
OBS-URL: https://build.opensuse.org/request/show/259678
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-astroid?expand=0&rev=8
- Update to 1.2.0
* Function nodes can detect decorator call chain and see if they are
decorated with builtin descriptors (`classmethod` and `staticmethod`).
* infer_call_result called on a subtype of the builtin type will now
return a new `Class` rather than an `Instance`.
* `Class.metaclass()` now handles module-level __metaclass__ declaration
on python 2, and no longer looks at the __metaclass__ class attribute on
python 3.
* Function nodes can detect if they are decorated with subclasses
of builtin descriptors when determining their type
(`classmethod` and `staticmethod`).
* Add `slots` method to `Class` nodes, for retrieving
the list of valid slots it defines.
* Expose function annotation to astroid: `Arguments` node
exposes 'varargannotation', 'kwargannotation' and 'annotations'
attributes, while `Function` node has the 'returns' attribute.
* Backported most of the logilab.common.modutils module there, as
most things there are for pylint/astroid only and we want to be
able to fix them without requiring a new logilab.common release
* Fix names grabed using wildcard import in "absolute import mode"
(ie with absolute_import activated from the __future__ or with
python 3). Fix pylint issue #58.
* Add support in pylint-brain for understanding enum classes.
OBS-URL: https://build.opensuse.org/request/show/244298
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-astroid?expand=0&rev=6