* Add support for Python 3.13.
* Remove support for Python 3.8 (and constants `PY38`,
`PY39_PLUS`, and `PYPY_7_3_11_PLUS`).
* Add the ``__annotations__`` attribute to the ``ClassDef`` object model.
* Implement inference for JoinedStr and FormattedValue
* Add support for ``ssl.OP_LEGACY_SERVER_CONNECT`` (new in Python 3.12).
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-astroid?expand=0&rev=105
- update to 3.2.2:
* Improve inference for generic classes using the PEP 695
syntax (Python 3.12).
* Fix ``RecursionError`` in ``infer_call_result()`` for certain
``__call__`` methods.
* Add ``AstroidManager.prefer_stubs`` attribute to control the
astroid 3.2.0 feature that prefers stubs.
* ``igetattr()`` returns the last same-named function in a
class (instead of the first). This avoids false positives
in pylint with ``@overload``.
* Adds ``module_denylist`` to ``AstroidManager`` for modules to
be skipped during AST generation. Modules in this list will
cause an ``AstroidImportError`` to be raised when an AST
for them is requested.
* Make ``astroid.interpreter._import.util.is_namespace`` only
consider modules using a loader set to ``NamespaceLoader``
or ``None`` as namespaces.
OBS-URL: https://build.opensuse.org/request/show/1185391
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-astroid?expand=0&rev=51
* Improve inference for generic classes using the PEP 695
syntax (Python 3.12).
* Fix ``RecursionError`` in ``infer_call_result()`` for certain
``__call__`` methods.
* Add ``AstroidManager.prefer_stubs`` attribute to control the
astroid 3.2.0 feature that prefers stubs.
* ``igetattr()`` returns the last same-named function in a
class (instead of the first). This avoids false positives
in pylint with ``@overload``.
* Adds ``module_denylist`` to ``AstroidManager`` for modules to
be skipped during AST generation. Modules in this list will
cause an ``AstroidImportError`` to be raised when an AST
for them is requested.
* Make ``astroid.interpreter._import.util.is_namespace`` only
consider modules using a loader set to ``NamespaceLoader``
or ``None`` as namespaces.
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-astroid?expand=0&rev=101
- update to 3.1.0:
* Include PEP 695 (Python 3.12) generic type syntax nodes in
``get_children()``, allowing checkers to visit them.
* Add ``__main__`` as a possible inferred value for
``__name__`` to improve control flow inference around
``if __name__ == "__main__":`` guards.
* Following a deprecation period, the ``names`` arg to the
``Import`` constructor and the ``op`` arg to the ``BoolOp``
constructor are now required, and the ``doc`` args
to the ``PartialFunction`` and ``Property`` constructors
have been removed (call ``postinit(doc_node=...)`` instead.)
* Following a deprecation announced in astroid 1.5.0, the alias
``AstroidBuildingException`` is removed in favor of
``AstroidBuildingError``.
* Include modname in AST warnings. Useful for ``invalid escape
sequence`` warnings with Python 3.12.
* ``RecursionError`` is now trapped and logged out as
``UserWarning`` during astroid node transformations with
instructions about raising the system recursion limit.
* Suppress ``SyntaxWarning`` for invalid escape sequences on
Python 3.12 when parsing modules.
OBS-URL: https://build.opensuse.org/request/show/1160817
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-astroid?expand=0&rev=50
* Include PEP 695 (Python 3.12) generic type syntax nodes in
``get_children()``, allowing checkers to visit them.
* Add ``__main__`` as a possible inferred value for
``__name__`` to improve control flow inference around
``if __name__ == "__main__":`` guards.
* Following a deprecation period, the ``names`` arg to the
``Import`` constructor and the ``op`` arg to the ``BoolOp``
constructor are now required, and the ``doc`` args
to the ``PartialFunction`` and ``Property`` constructors
have been removed (call ``postinit(doc_node=...)`` instead.)
* Following a deprecation announced in astroid 1.5.0, the alias
``AstroidBuildingException`` is removed in favor of
``AstroidBuildingError``.
* Include modname in AST warnings. Useful for ``invalid escape
sequence`` warnings with Python 3.12.
* ``RecursionError`` is now trapped and logged out as
``UserWarning`` during astroid node transformations with
instructions about raising the system recursion limit.
* Suppress ``SyntaxWarning`` for invalid escape sequences on
Python 3.12 when parsing modules.
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-astroid?expand=0&rev=99
- update to 3.0.2:
* Avoid duplicate inference results for some uses of
``typing.X`` constructs like ``Tuple[Optional[int], ...]``.
This was causing pylint to occasionally omit messages like
``deprecated-typing-alias``.
- Correct Requires for typing_extensions.
- Update to 2.12.13:
- Update to 2.12.12:
set to None.
Closes#1755
FunctionDef parent but are now correctly parented to their
- Drop part_rm_dep_imp.patch fixed upstream
* Properly construct the arguments of infered property descriptors
* Properly analyze CFFI compiled extensions.
* brain plugins can now register hooks to handle failed imports,
* Fix names grabed using wildcard import in "absolute import mode"
(ie with absolute_import activated from the __future__ or with
* fix#20760: crash on pyreverse : AttributeError: 'Subscript'
by Dave Borowitz
* new InstanceMethod node introduced to wrap bound method (eg
* compatibility with python2.3 and logilab-common 0.21
* .locals and .globals on scoped node handle now a list of
OBS-URL: https://build.opensuse.org/request/show/1135253
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-astroid?expand=0&rev=49
* Avoid duplicate inference results for some uses of
``typing.X`` constructs like ``Tuple[Optional[int], ...]``.
This was causing pylint to occasionally omit messages like
``deprecated-typing-alias``.
- Correct Requires for typing_extensions.
- Update to 2.12.13:
- Update to 2.12.12:
set to None.
Closes#1755
FunctionDef parent but are now correctly parented to their
- Drop part_rm_dep_imp.patch fixed upstream
* Properly construct the arguments of infered property descriptors
* Properly analyze CFFI compiled extensions.
* brain plugins can now register hooks to handle failed imports,
* Fix names grabed using wildcard import in "absolute import mode"
(ie with absolute_import activated from the __future__ or with
* fix#20760: crash on pyreverse : AttributeError: 'Subscript'
by Dave Borowitz
* new InstanceMethod node introduced to wrap bound method (eg
* compatibility with python2.3 and logilab-common 0.21
* .locals and .globals on scoped node handle now a list of
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-astroid?expand=0&rev=97
- Update to 3.0.1
* Add support for Python 3.12, including PEP 695 type parameter syntax.
* Remove support for Python 3.7.
* Use the global inference cache when inferring, even without an explicit
InferenceContext.
* Following a deprecation period starting in astroid 2.7.0, the astroid.node_classes
and astroid.scoped_nodes modules have been removed in favor of astroid.nodes.node_classes
and astroid.nodes.scoped_nodes.
* Following a deprecation period starting in astroid 2.12.0, the astroid.mixins module
has been removed in favor of astroid.nodes._base_nodes (private).
* Remove @cached and @cachedproperty decorator (just use @cached_property from the stdlib).
* Remove the inference module. Node inference methods are now in the module
defining the node, rather than being associated to the node afterward.
* Move LookupMixIn to astroid.nodes._base_nodes and make it private.
* Remove the shims for OperationError, BinaryOperationError, and UnaryOperationError
in exceptions. They were moved to util in astroid 1.5.0.
* Reduce file system access in ast_from_file().
* nodes.FunctionDef no longer inherits from nodes.Lambda.
* infer_call_result now shares the same interface across all implementations.
* Remove unused and / or deprecated constants.
* The future argument to each method is deprecated and will be removed in astroid 4.0.
* So many more changes, see https://github.com/pylint-dev/astroid/blob/main/ChangeLog
for a complete list.
OBS-URL: https://build.opensuse.org/request/show/1118344
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-astroid?expand=0&rev=95
- update to 2.15.3:
* Fix ``infer_call_result()`` crash on methods called
``with_metaclass()``
* Suppress ``UserWarning`` when finding module specs.
- update to 2.15.2:
* Support more possible usages of ``attrs`` decorators.
* Restore behavior of setting a Call as a base for classes
created using ``six.with_metaclass()``,
and harden support for using enums as metaclasses in this
case.
* astroid now supports ``TryStar`` nodes from python 3.11 and
should be fully compatible with python 3.11.
* ``Formattedvalue.postinit`` is now keyword only. This is to
allow correct typing of the ``Formattedvalue`` class.
* ``Astroid`` now supports custom import hooks.
* ``astroid`` now infers return values from match cases.
* ``AstroidManager.clear_cache`` now also clears the inference
context cache.
* ``Astroid`` now retrieves the default values of keyword only
arguments and sets them on ``Arguments.kw_defaults``.
* ``Uninferable`` now has the type ``UninferableBase``. This is
to facilitate correctly type annotating code that uses this
singleton.
* Deprecate ``modutils.is_standard_module()``. It will be
removed in the next minor release.
* Fix ``are_exclusive`` function when a walrus operator is used
inside ``IfExp.test`` field.
OBS-URL: https://build.opensuse.org/request/show/1080002
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-astroid?expand=0&rev=42
* Support more possible usages of ``attrs`` decorators.
* Restore behavior of setting a Call as a base for classes
created using ``six.with_metaclass()``,
and harden support for using enums as metaclasses in this
case.
* astroid now supports ``TryStar`` nodes from python 3.11 and
should be fully compatible with python 3.11.
* ``Formattedvalue.postinit`` is now keyword only. This is to
allow correct typing of the ``Formattedvalue`` class.
* ``Astroid`` now supports custom import hooks.
* ``astroid`` now infers return values from match cases.
* ``AstroidManager.clear_cache`` now also clears the inference
context cache.
* ``Astroid`` now retrieves the default values of keyword only
arguments and sets them on ``Arguments.kw_defaults``.
* ``Uninferable`` now has the type ``UninferableBase``. This is
to facilitate correctly type annotating code that uses this
singleton.
* Deprecate ``modutils.is_standard_module()``. It will be
removed in the next minor release.
* Fix ``are_exclusive`` function when a walrus operator is used
inside ``IfExp.test`` field.
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-astroid?expand=0&rev=82
* Handle the effect of properties on the __init__ of a dataclass
correctly.
* Handle the effect of kw_only=True in dataclass fields correctly.
* Handle the effect of init=False in dataclass fields correctly.
* Fix crash if numpy module doesn't have version attribute.
* Handle AttributeError during str.format template inference tip
evaluation
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-astroid?expand=0&rev=80
- 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
- update to 2.9.3:
* 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/request/show/946671
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-astroid?expand=0&rev=35
* 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
- update to 2.8.5:
* 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/request/show/931287
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-astroid?expand=0&rev=33
* 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