Update dependency astroid to v2.5.7 #16
Merged
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.
This PR contains the following updates:
==2.0.4
->==2.5.7
Release Notes
PyCQA/astroid
v2.5.7
Compare Source
============================
Release Date: 2021-05-09
Fix six.with_metaclass transformation so it doesn't break user defined transformations.
Fix detection of relative imports.
Closes #930
Closes PyCQA/pylint#4186
Fix inference of instance attributes defined in base classes
Closes #932
Update
infer_named_tuple
brain to reject namedtuple definitionsthat would raise ValueError
Closes #920
Do not set instance attributes on builtin object()
Closes #945
Closes PyCQA/pylint#4232
Closes PyCQA/pylint#4221
Closes PyCQA/pylint#3970
Closes PyCQA/pylint#3595
Fix some spurious cycles detected in
context.path
leading to more casesthat can now be inferred
Closes #926
Add
kind
field toConst
nodes, matching the structure of the built-in ast Const.The kind field is "u" if the literal is a u-prefixed string, and
None
otherwise.Closes #898
Fix property inference in class contexts for properties defined on the metaclass
Closes #940
Update enum brain to fix definition of members for subclass-defined Enums
Closes PyCQA/pylint#3535
Closes PyCQA/pylint#4358
Update random brain to fix a crash with inference of some sequence elements
Closes #922
Fix inference of attributes defined in a base class that is an inner class
Closes #904
Allow inferring a return value of None for non-abstract empty functions and
functions with no return statements (implicitly returning None)
Closes #485
scm_setuptools has been added to the packaging.
Astroid's tags are now the standard form
vX.Y.Z
and notastroid-X.Y.Z
anymore.Add initial support for Pattern Matching in Python 3.10
v2.5.6
Compare Source
============================
Release Date: 2021-04-25
Closes PyCQA/pylint#4402
v2.5.5
Compare Source
============================
Release Date: 2021-04-24
Closes PyCQA/pylint#4393
v2.5.4
Compare Source
============================
Release Date: 2021-04-24
The packaging is now done via setuptools exclusively.
doc
,tests
, andChangelog
arenot packaged anymore - reducing the size of the package greatly.
Debian packaging is now (officially) done in https://salsa.debian.org/python-team/packages/astroid.
__pkginfo__
now only contain__version__
(also accessible withastroid.__version__
),other meta-information are still accessible with
import importlib;metadata.metadata('astroid')
.Added inference tip for
typing.Tuple
aliasFix crash when evaluating
typing.NamedTuple
Closes PyCQA/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.
Moved from appveyor and travis to Github Actions for continuous integration.
v2.5.3
Compare Source
============================
Release Date: 2021-04-10
Takes into account the fact that subscript inferring for a ClassDef may involve class_getitem method
Reworks the
collections
andtyping
brain so that pylint`s acceptance tests are fine.Closes PyCQA/pylint#4206
Use
inference_tip
fortyping.TypedDict
brain.Fix mro for classes that inherit from typing.Generic
Add inference tip for typing.Generic and typing.Annotated with
__class_getitem__
Closes PyCQA/pylint#2822
v2.5.2
Compare Source
============================
Release Date: 2021-03-28
Detects
import numpy
as a validnumpy
import.Closes PyCQA/pylint#3974
Iterate over
Keywords
when usingClassDef.get_children
Closes PyCQA/pylint#3202
v2.5.1
Compare Source
============================
Release Date: 2021-02-28
The
context.path
is reverted to a set because otherwise it leads to false positivesfor non
numpy
functions.Closes #895 #899
Don't transform dataclass ClassVars
Improve typing.TypedDict inference
Fix the
Duplicates found in MROs
false positive.Closes #905
Closes PyCQA/pylint#2717
Closes PyCQA/pylint#3247
Closes PyCQA/pylint#4093
Closes PyCQA/pylint#4131
Closes PyCQA/pylint#4145
v2.5
Compare Source
============================
Release Date: TBA
v2.4.2
Compare Source
============================
Release Date: 2020-06-08
FunctionDef.is_generator
properly handlesyield
nodes inWhile
testsClose PyCQA/pylint#3519
Properly construct the arguments of infered property descriptors
Close PyCQA/pylint#3648
v2.4.1
Compare Source
============================
Release Date: 2020-05-05
Handle the case where the raw builder fails to retrieve the
__all__
attributeClose #772
Restructure the AST parsing heuristic to always pick the same module
Close PyCQA/pylint#3540
Close #773
Changed setup.py to work with distlib
Close #779
Do not crash with SyntaxError when parsing namedtuples with invalid label
Close PyCQA/pylint#3549
Protect against
infer_call_result
failing withInferenceError
inSuper.getattr()
Close PyCQA/pylint#3529
v2.4.0
Compare Source
============================
Release Date: 2020-04-27
Expose a ast_from_string method in AstroidManager, which will accept
source code as a string and return the corresponding astroid object
Closes #725
BoundMethod.implicit_parameters
returns a proper value for__new__
Close PyCQA/pylint#2335
Allow slots added dynamically to a class to still be inferred
Close PyCQA/pylint#2334
Allow
FunctionDef.getattr
to look into both instance attrs and special attributesClose PyCQA/pylint#1078
Infer qualified
classmethod
as a classmethod.Close PyCQA/pylint#3417
Prevent a recursion error to happen when inferring the declared metaclass of a class
Close #749
Raise
AttributeInferenceError
whengetattr()
receives an empty nameClose PyCQA/pylint#2991
Prevent a recursion error for self reference variables and
type()
calls.Close #199
Do not infer the first argument of a staticmethod in a metaclass as the class itself
Close PyCQA/pylint#3032
NodeNG.bool_value()
gained an optionalcontext
parameterWe need to pass an inference context downstream when inferring the boolean
value of a node in order to prevent recursion errors and double inference.
This fix prevents a recursion error with dask library.
Close PyCQA/pylint#2985
Pass a context argument to
astroid.Arguments
to prevent recursion errorsClose PyCQA/pylint#3414
Better inference of class and static methods decorated with custom methods
Close PyCQA/pylint#3209
Reverse the order of decorators for
infer_subscript
path_wrapper
needs to come first, followed byraise_if_nothing_inferred
,otherwise we won't handle
StopIteration
correctly.Close #762
Prevent a recursion error when inferring self-referential variables without definition
Close PyCQA/pylint#1285
Numpy
datetime64.astype
return value is inferred as andarray
.Close PyCQA/pylint#3332
Skip non
Assign
andAnnAssign
nodes from enum reinterpretationCloses PyCQA/pylint#3365
Numpy
ndarray
attributesimag
andreal
are now inferred asndarray
.Close PyCQA/pylint#3322
Added a call to
register_transform
for all functions of thebrain_numpy_core_multiarray
module in case the current node is an instance of
astroid.Name
Close #666
Use the parent of the node when inferring aug assign nodes instead of the statement
Close PyCQA/pylint#2911
Close PyCQA/pylint#3214
Added some functions to the
brain_numpy_core_umath
moduleClose PyCQA/pylint#3319
Added some functions of the
numpy.core.multiarray
moduleClose PyCQA/pylint#3208
All the
numpy ufunc
functions derived now from a common class thatimplements the specific
reduce
,accumulate
,reduceat
,outer
andat
methods.Close PyCQA/pylint#2885
nodes.Const.itered
returns a list ofConst
nodes, not stringsClose PyCQA/pylint#3306
The
shape
attribute of anumpy ndarray
is now andarray
Close PyCQA/pylint#3139
Don't ignore special methods when inspecting gi classes
Close #728
Added transform for
scipy.gaussian
Add suport for inferring properties.
Added a brain for
responses
Allow inferring positional only arguments.
Retry parsing a module that has invalid type comments
It is possible for a module to use comments that might be interpreted
as type comments by the
ast
library. We do not want to completely crash on thoseinvalid type comments.
Close #708
Scope the inference to the current bound node when inferring instances of classes
When inferring instances of classes from arguments, such as
self
in a bound method, we could use as a hint the context's
boundnode
,which indicates the instance from which the inference originated.
As an example, a subclass that uses a parent's method which returns
self
, will override theself
to point to it instead of pointingto the parent class.
Close PyCQA/pylint#3157
Add support for inferring exception instances in all contexts
We were able to infer exception instances as
ExceptionInstance
only for a handful of cases, but not all.
ExceptionInstance
hassupport for better inference of
.args
and other exception relatedattributes that normal instances do not have.
This additional support should remove certain false positives related
to
.args
and other exception attributes inpylint
.Close PyCQA/pylint#2333
Add more supported parameters to
subprocess.check_output
Close #722
Infer args unpacking of
self
Certain stdlib modules use
*args
to encapsulatethe
self
parameter, which results in uninferableinstances given we rely on the presence of the
self
argument to figure out the instance where we should be
setting attributes.
Close PyCQA/pylint#3216
Clean up setup.py
Make pytest-runner a requirement only if running tests, similar to what was
done with McCabe.
Clean up the setup.py file, resolving a handful of minor warnings with it.
Handle StopIteration error in infer_int.
Close PyCQA/pylint#3274
Can access per argument type comments for positional only and keyword only arguments.
The comments are accessed through through the new
Arguments.type_comment_posonlyargs
andArguments.type_comment_kwonlyargs
attributes respectively.Relax upper bound on
wrapt
Close #755
Properly analyze CFFI compiled extensions.
v2.3.3
Compare Source
v2.3.2
Compare Source
============================
Release Date: TBA
All type comments have as parent the corresponding
astroid
nodeUntil now they had as parent the builtin
ast
node which meantwe were operating with primitive objects instead of our own.
Close PyCQA/pylint#3174
Pass an inference context to
metaclass()
when inferring an object typeThis should prevent a bunch of recursion errors happening in pylint.
Also refactor the inference of
IfExp
nodes to use separate contextsfor each potential branch.
Close PyCQA/pylint#3152
Close PyCQA/pylint#3159
v2.3.1
Compare Source
============================
Release Date: 2019-09-30
A transform for the builtin
dataclasses
module was added.This should address various
dataclasses
issues that were surfacedeven more after the release of pylint 2.4.0.
In the previous versions of
astroid
, annotated assign nodes wereallowed to be retrieved via
getattr()
but that no longer happenswith the latest
astroid
release, as those attribute are not actualattributes, but rather virtual ones, thus an operation such as
getattr()
does not make sense for them.
Update attr brain to partly understand annotated attributes
Close #656
v2.3.0
Compare Source
============================
Release Date: 2019-09-24
Add a brain tip for
subprocess.check_output
Close #689
Remove NodeNG.nearest method because of lack of usage in astroid and pylint.
Close #691
Allow importing wheel files. Close #541
Annotated AST follows PEP8 coding style when converted to string.
Fix a bug where defining a class using type() could cause a DuplicateBasesError.
Close #644
Dropped support for Python 3.4.
Numpy brain support is improved.
Numpy's fundamental type
numpy.ndarray
has its own brain :brain_numpy_ndarray
andeach numpy module that necessitates brain action has now its own numpy brain :
numpy.core.numeric
numpy.core.function_base
numpy.core.multiarray
numpy.core.numeric
numpy.core.numerictypes
numpy.core.umath
numpy.random.mtrand
Close PyCQA/pylint#2865
Close PyCQA/pylint#2747
Close PyCQA/pylint#2721
Close PyCQA/pylint#2326
Close PyCQA/pylint#2021
assert
only functions are properly inferred as returningNone
Close #668
Add support for Python 3.8's
NamedExpr
nodes, which is part of assignment expressions.Close #674
Added support for inferring
IfExp
nodes.Instances of exceptions are inferred as such when inferring in non-exception context
This allows special inference support for exception attributes such as
.args
.Close PyCQA/pylint#2333
Drop a superfluous and wrong callcontext when inferring the result of a context manager
Close PyCQA/pylint#2859
igetattr
raisesInferenceError
on re-inference of the same objectThis prevents
StopIteration
from leaking when we encounter the sameobject in the current context, which could result in various
RuntimeErrors
leaking in other parts of the inference.
Until we get a global context per inference, the solution is sort of a hack,
as with the suggested global context improvement, we could theoretically
reuse the same inference object.
Close #663
Variable annotations can no longer be retrieved with
ClassDef.getattr
Unless they have an attached value, class variable annotations can no longer
be retrieved with
ClassDef.getattr.
Improved builtin inference for
tuple
,set
,frozenset
,list
anddict
We were properly inferring these callables only if they had consts as
values, but that is not the case most of the time. Instead we try to infer
the values that their arguments can be and use them instead of assuming
Const nodes all the time.
Close PyCQA/pylint#2841
The last except handler wins when inferring variables bound in an except handler.
Close PyCQA/pylint#2777
threading.Lock.locked()
is properly recognized as a member ofthreading.Lock
Close PyCQA/pylint#2791
Fix recursion error involving
len
and self referential attributesClose PyCQA/pylint#2736
Close PyCQA/pylint#2734
Close PyCQA/pylint#2740
Can access per argument type comments through new
Arguments.type_comment_args
attribute.Close #665
Fix being unable to access class attributes on a NamedTuple.
Close PyCQA/pylint#1628
Fixed being unable to find distutils submodules by name when in a virtualenv.
Close PyCQA/pylint#73
v2.2.5
Compare Source
v2.2.4
Compare Source
v2.2.1
Compare Source
v2.2.0
Compare Source
============================
Release Date: 2019-02-27
Close PyCQA/pylint#2436
Fix a bug where a method, which is a lambda built from a function, is not inferred as
BoundMethod
Close PyCQA/pylint#2594
typed_ast
gets installed for Python 3.7, meaning type comments can now work on 3.7.Fix a bug concerning inference of unary operators on numpy types.
Close PyCQA/pylint#2436 (first part)
Fix a crash with
typing.NamedTuple
and empty fields. Close PyCQA/pylint#2745Add a proper
strerror
inference to theOSError
exceptions.Close PyCQA/pylint#2553
Support non-const nodes as values of Enum attributes.
Close #612
Fix a crash in the
enum
brain tip caused by non-assign members in class definitions.Close PyCQA/pylint#2719
brain_numpy
returns an undefined type fornumpy
methods to avoidassignment-from-no-return
Close PyCQA/pylint#2694
Fix a bug where a call to a function that has been previously called via
functools.partial was wrongly inferred
Close PyCQA/pylint#2588
Fix a recursion error caused by inferring the
slice
builtin.Close PyCQA/pylint#2667
Remove the restriction that "old style classes" cannot have a MRO.
This does not make sense any longer given that we run against Python 3
code.
Close PyCQA/pylint#2701
Added more builtin exceptions attributes. Close #580
Add a registry for builtin exception models. Close PyCQA/pylint#1432
Add brain tips for
http.client
. Close PyCQA/pylint#2687Prevent crashing when processing
enums
with mixed single and double quotes.Close PyCQA/pylint#2676
typing
types have the__args__
property. Close PyCQA/pylint#2419Fix a bug where an Attribute used as a base class was triggering a crash
Close #626
Added special support for
enum.IntFlag
Close PyCQA/pylint#2534
Extend detection of data classes defined with attr
Close #628
Fix typo in description for brain_attrs
v2.1.0
Compare Source
============================
Release Date: 2018-11-25
threading.Lock.acquire
has thetimeout
parameter now.Close PyCQA/pylint#2457
Pass parameters by keyword name when inferring sequences.
Close PyCQA/pylint#2526
Correct line numbering for f-strings for complex embedded expressions
When a f-string contained a complex expression, such as an attribute access,
we weren't cloning all the subtree of the f-string expression for attaching the correct
line number. This problem is coming from the builtin AST parser which gives for the f-string
and for its underlying elements the line number 1, but this is causing all sorts of bugs and
problems in pylint, which expects correct line numbering.
Close PyCQA/pylint#2449
Add support for
argparse.Namespace
Close PyCQA/pylint#2413
async
functions are now inferred asAsyncGenerator
when inferring their call result.Filter out
Uninferable
when inferring the call result result of a class with an uninferable__call__
method.Close PyCQA/pylint#2434
Make compatible with AST changes in Python 3.8.
Subscript inference (e.g. "
a[i]
") now pays attention to multiple inferred values for value(e.g. "
a
") and slice (e.g. "i
")Close #614
Configuration
📅 Schedule: At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by WhiteSource Renovate. View repository job log here.