Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
astroid
version2.12.1
https://github.com/PyCQA/astroid/tree/v2.12.1
requires-python = ">=3.7.2"
https://github.com/PyCQA/astroid/blob/v2.12.1/pyproject.toml#L33
wrapt>=1.11,<2
https://github.com/PyCQA/astroid/blob/v2.12.1/pyproject.toml#L36
"lazy_object_proxy>=1.4.0"
https://github.com/PyCQA/astroid/blob/v2.12.1/pyproject.toml#L35
typed-ast>=1.4.0,<2.0
https://github.com/PyCQA/astroid/blob/v2.12.1/pyproject.toml#L37
typing-extensions>=3.10
https://github.com/PyCQA/astroid/blob/v2.12.1/pyproject.toml#L38
"setuptools~=62.6"
"wheel~=0.37.1"
https://github.com/PyCQA/astroid/blob/v2.12.1/pyproject.toml#L2
https://github.com/PyCQA/astroid/blob/v2.12.1/ChangeLog
What's New in astroid 2.12.1?
=============================
Release date: 2022-07-10
Fix a crash when inferring old-style string formatting (
%
) using tuples.Fix a crash when
None
(or a value inferred asNone
) participates in a**
expression.Fix a crash involving properties within
if
blocks.What's New in astroid 2.12.0?
Release date: 2022-07-09
Fix signal has no
connect
member for PySide2 5.15.2+ and PySide6Closes #4040, #5378
astroid
now requires Python 3.7.2 to run.Avoid setting a Call as a base for classes created using
six.with_metaclass()
.Refs Crash
argument of type 'Const' is not iterable
pylint-dev/pylint#5935Fix detection of builtins on
PyPy
3.9.Fix
re
brain on Python3.11
. The flags now come fromre._compile
.Build
nodes.Module
for frozen modules which have location information in theirModuleSpec
.Closes #1512
collections_abc
will be frozen in 3.11collections_abc
will be frozen in 3.11 pylint-dev/astroid#1512The
astroid.mixins
module has been deprecated and marked for removal in 3.0.0.Closes #1633
Move
mixins.py
toastroid.nodes._base_nodes
Move
mixins.py
toastroid.nodes._base_nodes
pylint-dev/astroid#1633Capture and log messages emitted by C extensions when importing them.
This prevents contaminating programmatic output, e.g. pylint's JSON reporter.
Closes Pylint not suppressing the stdout of C loaded extensions pylint-dev/pylint#3518
Calls to
str.format
are now correctly inferred.Closes astroid v2.12.10 conda-forge/astroid-feedstock#104, Closes #1611
Infer calls to str.format() on names #
Infer calls to str.format() on names pylint-dev/astroid#1611
__new__
and__init__
have been added to theObjectModel
and are nowinferred as
BoundMethods
.Old style string formatting (using
%
operators) is now correctly inferred.Closes astroid v3.3.6 conda-forge/astroid-feedstock#151
Infer string interpolation with %
Infer string interpolation with
%
pylint-dev/astroid#151Adds missing enums from
ssl
module.Closes ssl.VerifyMode and other Enums not recognized pylint-dev/pylint#3691
Remove dependency on
pkg_resources
fromsetuptools
.Closes #1103
Remove dependency to
setuptools
anddistutil
Remove dependency to
setuptools
anddistutil
pylint-dev/astroid#1103Allowed
AstroidManager.clear_cache
to reload necessary brain plugins.Fixed incorrect inferences after rebuilding the builtins module, e.g. by calling
AstroidManager.clear_cache
.Closes #1559
Pollution test cases
Pollution test cases pylint-dev/astroid#1559
On Python versions >= 3.9,
astroid
now understands subscriptingbuiltin classes such as
enumerate
orstaticmethod
.Fixed inference of
Enums
when they are imported under an alias.Closes False positive
no-member
forenum.Enum
when imported with alias pylint-dev/pylint#5776Rename
ModuleSpec
->module_type
constructor parameter to match attributename and improve typing. Use
type
instead.ObjectModel
andClassModel
now know about their__new__
and__call__
attributes.Fixed pylint
not-callable
false positive with nested-tuple assignment in a for-loop.Refs False positive not callable for function call in dictionary pylint-dev/pylint#5113
Instances of builtins created with
__new__(cls, value)
are now inferred.Infer the return value of the
.copy()
method ondict
,list
,set
,and
frozenset
.Closes #1403
dict.copy() result is not inferred as dict
dict.copy() result is not inferred as dict pylint-dev/astroid#1403
Fixed inference of elements of living container objects such as tuples and sets in the
sys
andssl
modules.Add
pathlib
brain to handlepathlib.PurePath.parents
inference.Closes pylint trigger false-positive
no-member
error when usingpathlib.Path
parents function pylint-dev/pylint#5783Avoid inferring the results of
**
operations involving values greater than1e5
to avoid expensive computation.
Closes Slow performance with large numbers pylint-dev/pylint#6745
Fix test for Python
3.11
. In some instanceserr.__traceback__
willbe uninferable now.
Add brain for numpy core module
einsumfunc
.Closes False positive E1130 invalid-unary-operand-type from Numpy einsum pylint-dev/pylint#5821
Infer the
DictUnpack
value forDict.getitem
calls.Closes #1195
getitem does not infer the actual unpacked value
getitem does not infer the actual unpacked value pylint-dev/astroid#1195
Fix a crash involving properties within
try ... except
blocks.Closes Incorrect too-many-function-args for a function defined and called within a class pylint-dev/pylint#6592
Prevent creating
Instance
objects that proxy otherInstance
s when there isambiguity (or user error) in calling
__new__(cls)
.Refs TypeError: getattr() got an unexpected keyword argument 'class_context' pylint-dev/pylint#7109
What's New in astroid 2.11.7?
Release date: 2022-07-09
Added support for
usedforsecurity
keyword tohashlib
constructors.Closes hashlib constructors unexpected-argument false positive for
usedforsecurity
pylint-dev/pylint#6017Updated the stdlib brain for
subprocess.Popen
to accommodate Python 3.9+.Closes False positive unexpected-keyword-arg for user keyword argument in subprocess.Popen() pylint-dev/pylint#7092
What's New in astroid 2.11.6?
Release date: 2022-06-13
The Qt brain now correctly treats calling
.disconnect()
(with noarguments) on a slot as valid.
The argparse brain no longer incorrectly adds
"Namespace"
to the localsof functions that return an
argparse.Namespace
object.Refs
unused-variable
false-positive regression forargparse.Namespace
pylint-dev/pylint#6895What's New in astroid 2.11.5?
Release date: 2022-05-09
Fix crash while obtaining
object_type()
of anUnknown
node.Refs Crash when attempting to access a builtin's
__code__
pylint-dev/pylint#6539Fix a bug where in attempting to handle the patching of
distutils
byvirtualenv
,library submodules called
distutils
(e.g.numpy.distutils
) were included also.Refs Pylint (>=2.13.0) cannot find
misc_util
module innumpy.distutils
pylint-dev/pylint#6497What's New in astroid 2.11.4?
Release date: 2022-05-02
Fix
col_offset
attribute for nodes involvingwith
onPyPy
.Fixed a crash involving two starred expressions: one inside a comprehension,
both inside a call.
Refs Crash in IterableChecker with starred expression pylint-dev/pylint#6372
Made
FunctionDef.implicit_parameters
return 1 for methods by makingFunctionDef.is_bound
returnTrue
, as it does for class methods.Closes False positive
no-value-for-parameter
for Qt methods pylint-dev/pylint#6464Fixed a crash when
_filter_stmts
encounters anEmptyNode
.Closes Crash when linting LeoQt pylint-dev/pylint#6438
What's New in astroid 2.11.3?
Release date: 2022-04-19
Fixed an error in the Qt brain when building
instance_attrs
.Closes 'str' object has no attribute 'parent' pylint-dev/pylint#6221
Fixed a crash in the
gi
brain.Closes Crash
invalid enum value: 6
when importing cairo pylint-dev/pylint#6371What's New in astroid 2.11.2?
Release date: 2022-03-26
Avoided adding the name of a parent namedtuple to its child's locals.
Refs TypeError: '<' not supported between instances of 'int' and 'NoneType' pylint-dev/pylint#5982
What's New in astroid 2.11.1?
Release date: 2022-03-22
Promoted
getattr()
fromastroid.scoped_nodes.FunctionDef
to its parentastroid.scoped_nodes.Lambda
.Fixed crash on direct inference via
nodes.FunctionDef._infer
.Closes #817
IndexError in FunctionDef._infer()
pylint-dev/astroid#817
What's New in astroid 2.11.0?
Release date: 2022-03-12
Add new (optional)
doc_node
attribute tonodes.Module
,nodes.ClassDef
,and
nodes.FunctionDef
.Accessing the
doc
attribute ofnodes.Module
,nodes.ClassDef
, andnodes.FunctionDef
has been deprecated in favour of thedoc_node
attribute.Note:
doc_node
is an (optional)nodes.Const
whereasdoc
was an (optional)str
.Passing the
doc
argument to the__init__
ofnodes.Module
,nodes.ClassDef
,and
nodes.FunctionDef
has been deprecated in favour of thepostinit
doc_node
attribute.Note:
doc_node
is an (optional)nodes.Const
whereasdoc
was an (optional)str
.Replace custom
cachedproperty
withfunctools.cached_property
and deprecate itfor Python 3.8+.
Closes #1410
Replace
cachedproperty
withfunctools.cached_property
(>= 3.8)Replace
cachedproperty
withfunctools.cached_property
(>= 3.8) pylint-dev/astroid#1410Set
end_lineno
andend_col_offset
attributes toNone
for all nodeswith PyPy 3.8. PyPy 3.8 assigns these attributes inconsistently which could lead
to unexpected errors. Overwriting them with
None
will cause a fallbackto the already supported way of PyPy 3.7.
Add missing
shape
parameter to numpyzeros_like
,ones_like
,and
full_like
methods.Closes numpy.zeros_like false positive when using shape kwarg pylint-dev/pylint#5871
Only pin
wrapt
on the major version.What's New in astroid 2.10.0?
Release date: 2022-02-27
Fixed inference of
self
in binary operations in whichself
is part of a list or tuple.
Closes False positive with operator+ and lists (no-member) pylint-dev/pylint#4826
Fixed builtin inference on
property
calls not calling thepostinit
of the new node, whichresulted in instance arguments missing on these nodes.
Fixed a crash on
Super.getattr
when the attribute was previously uninferable due to a cachelimit size. This limit can be hit when the inheritance pattern of a class (and therefore of the
__init__
attribute) is very large.Closes linting code containing sqlalchemy FunctionElement and compiler.compiles crashes pylint with an InferenceError exception pylint-dev/pylint#5679
Inlcude names of keyword-only arguments in
astroid.scoped_nodes.Lambda.argnames
.Closes False positive W0613 with keyword only argument pylint-dev/pylint#5771
Fixed a crash inferring on a
NewType
named with an f-string.Closes AstroidSyntaxError when parsing NewType pylint-dev/pylint#5770
Add support for attrs v21.3.0 which
added a new
attrs
module alongside the existingattr
.Closes #1330
brain_attrs.py
does not support attrs v21.3.0+brain_attrs.py
does not support attrs v21.3.0+ pylint-dev/astroid#1330Use the
end_lineno
attribute for theNodeNG.tolineno
propertywhen it is available.
Closes #1350
Decorator.toline is off by 1
Decorator.toline is off by 1 pylint-dev/astroid#1350
Add
is_dataclass
attribute toClassDef
nodes.Use
sysconfig
instead ofdistutils
to determine the location ofpython stdlib files and packages.
Related pull requests: #1322, #1323, #1324
Closes #1282
Ref #1103
Change site packages look up to use sysconfig instead of distutils
Change site packages look up to use sysconfig instead of distutils pylint-dev/astroid#1322
Use
sysconfig.get_path
instead ofdistutils
to findstdlib
Use
sysconfig.get_path
instead ofdistutils
to findstdlib
pylint-dev/astroid#1323Use
sysconfig
to determinestdlib
paths forPyPy
Use
sysconfig
to determinestdlib
paths forPyPy
pylint-dev/astroid#1324Python 3.10 deprecation warnings due to
distutils
importPython 3.10 deprecation warnings due to
distutils
import pylint-dev/astroid#1282Remove dependency to
setuptools
anddistutil
Remove dependency to
setuptools
anddistutil
pylint-dev/astroid#1103Fixed crash with recursion error for inference of class attributes that referenced
the class itself.
Closes pylint endless recursion with short example using setuptools.build_meta import pylint-dev/pylint#5408
Fixed crash when trying to infer
items()
on the__dict__
attribute of an imported module.
Closes #1085
AttributeInferenceError: Could not find original name for items in
Import
AttributeInferenceError: Could not find original name for items in
Import
pylint-dev/astroid#1085Add optional
NodeNG.position
attribute.Used for block nodes to highlight position of keyword(s) and name
in cases where the AST doesn't provide good enough positional information.
E.g.
nodes.ClassDef
,nodes.FunctionDef
.Fix
ClassDef.fromlineno
. For Python < 3.8 thelineno
attribute includes decorators.fromlineno
should return the line of theclass
statement itself.Performance improvements. Only run expensive decorator functions when
non-default Deprecation warnings are enabled, eg. during a Pytest run.
Closes #1383
Fix performance issue with
inspect
calls in deprecation warnings decoratorsFix performance issue with
inspect
calls in deprecation warnings decorators pylint-dev/astroid#1383What's New in astroid 2.9.3?
Release date: 2022-01-09
Fixed regression where packages without a
__init__.py
file werenot recognized or imported correctly.
Closes #1327
astroid 2.9.1 breaks pylint with missing init.py: F0010: error while code parsing: Unable to load file init.py
astroid 2.9.1 breaks pylint with missing __init__.py: F0010: error while code parsing: Unable to load file __init__.py pylint-dev/astroid#1327
What's New in astroid 2.9.2?
Release date: 2022-01-04
astroid.scoped_nodes
where_is_metaclass
was not accessible anymore.
Closes #1325
Fix import astroid.scoped_nodes
pylint-dev/astroid#1325
What's New in astroid 2.9.1?
Release date: 2021-12-31
NodeNG.frame()
andNodeNG.statement()
will start raisingParentMissingError
instead of
AttributeError
in astroid 3.0. This behaviour can already be triggeredby passing
future=True
to aframe()
orstatement()
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.Ref #1321
Remove
distutils
path patchingRemove
distutils
path patching pylint-dev/astroid#1321Restore custom
distutils
handling for resolving paths to submodules.Closes [2.12.x] false positives: no-name-in-module, import-error pylint-dev/pylint#5645
Fix
deque.insert()
signature incollections
brain.Closes #1260
deque.insert() has reversed args
deque.insert() has reversed args pylint-dev/astroid#1260
Fix
Module
nodes not having acol_offset
,end_lineno
, andend_col_offset
attributes.
Fix typing and update explanation for
Arguments.args
beingNone
.Fix crash if a variable named
type
is accessed with an index operator ([]
)in a generator expression.
Closes 'ListComp' object has no attribute 'name' when variable is named "type" pylint-dev/pylint#5461
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).
Closes #823
Closes Contents of native modules not found when running in a virtualenv pylint-dev/pylint#3499
Closes False positive on gethostname in socket module pylint-dev/pylint#4302
Closes False positives in socket library pylint-dev/pylint#4798
Closes Regression: False positive I1101(c-extension-no-member) for math.iclose pylint-dev/pylint#5081
What's New in astroid 2.9.0?
Release date: 2021-11-21
Add
end_lineno
andend_col_offset
attributes to astroid nodes.Always treat
__class_getitem__
as a classmethod.Add missing
as_string
visitor method forUnknown
node.Closes #1264
'AsStringVisitor' object has no attribute 'visit_unknown'
'AsStringVisitor' object has no attribute 'visit_unknown' pylint-dev/astroid#1264
https://github.com/conda-forge/astroid-feedstock/issues
There are currently no open issues mentioned at the time of the review.
dev_url
https://github.com/PyCQA/astroid
doc_url
There seems to be a redirect to the following location
https://pylint.pycqa.org/projects/astroid/en/latest/?badge=latest
spdx
compliantLGPL-2.1-or-later
LGPL
build_number
is correctsetuptools
setuptools
setuptools
wheel
wheel
pip
in the test sectionpython
architecture specific
orNoarch
Results:
Based on the research findings and the results we can conclude
that it is safe to update
astroid
to version2.12.1