-
-
Notifications
You must be signed in to change notification settings - Fork 305
Bump astroid to 4.0.0, update changelog #2848
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bump astroid to 4.0.0, update changelog #2848
Conversation
LGTM But we need a cleanup of the history if we want to rebase to have two commits |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2848 +/- ##
=======================================
Coverage 93.37% 93.37%
=======================================
Files 92 92
Lines 11148 11148
=======================================
Hits 10409 10409
Misses 739 739
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
6a2cf66
to
cfb9158
Compare
I guess this is our last chance to add some pylint tests before these issues get auto-closed. |
Right, I guess it's the still opened issues that are from pylint without being refs so only: |
Working on it |
cfb9158
to
f50dc56
Compare
(The only unreleased commits on the maintenance branch were tooling updates, so we can avoid doing a 3.3 patch.)
What's New in astroid 4.0.0?
Release date: 2025-10-05
Support constraints from ternary expressions in inference.
Closes [not-an-iterable] FP for attribute used in comprehension but guarded in if test pylint#9729
Handle deprecated
bool(NotImplemented)
cast in const nodes.Add support for boolean truthiness constraints (
x
,not x
) in inference.Closes [unsubscriptable-object] False Positive on Optional list pylint#9515
Fix false positive
invalid-name
onattrs
classes withClassVar
annotated variables.Closes false positive invalid-name on attrs classvar pylint#10525
Prevent crash when parsing deeply nested parentheses causing MemoryError in python's built-in ast.
Closes MemoryError when parsing deeply nested parentheses #2643
Fix crash when inferring namedtuple with invalid field name looking like f-string formatting.
Closes ValueError when stringifying namedtuple exception that contains invalid format string #2519
Fix false positive no-member in except * handler.
Closes False type inference: no-member in except* pylint#9056
Fix crash when comparing invalid dict literal
Closes "TypeError: unhashable type: 'dict'" when comparing invalid dict literal #2522
Removed internal functions
infer_numpy_member
,name_looks_like_numpy_member
, andattribute_looks_like_numpy_member
fromastroid.brain.brain_numpy_utils
.To alleviate circular imports, the
manager
argument toAstroidBuilder()
is now required.Constants now have a parent of
nodes.SYNTHETIC_ROOT
.Fix crashes with large positive and negative list multipliers.
Closes OverflowError in _multiply_seq_by_int #2521
Closes MemoryError in _multiply_seq_by_int when constructing large list #2523
Fix precedence of
path
arg inmodpath_from_file_with_callback
to be higher thansys.path
Following a deprecation period, the
future
argument was removed fromstatement()
andframe()
.Improve consistency of
JoinedStr
inference by not raisingInferenceError
andreturning either
Uninferable
or a fully resolvedConst
.Closes Inference of JoinedStr is inconsistent #2621
Fix crash when typing._alias() call is missing arguments.
Closes IndexError when _alias() has no arguments #2513
Remove support for Python 3.9 (and constant
PY310_PLUS
).Include subclasses of standard property classes as
property
decoratorsCloses #10377
Modify
astroid.bases
andtests.test_nodes
to reflect thatenum.property
was added in Python 3.11, not 3.10Fix incorrect result in
_get_relative_base_path
when the target directory name starts with the base pathCloses modutils._get_relative_base_path returns incorrect result when directory name starts with directory name in path_to_check #2608
The brain for nose was dropped. nose has been deprecated for 10 years and the brain required some maintenance.
Refs [maintenance] Drop the brain for nose, filter warning on tests for old style namespace packages #2765
Fix a crash when the root of a node is not a module but is unknown.
Closes AssertionError when root is not a module #2672
Add basic support for
ast.TemplateStr
andast.Interpolation
added in Python 3.14.Refs TemplateString: Proper inference similar to JoinedStr._infer and additional tests for the as_string() #2789
Add support for type parameter defaults added in Python 3.13.
Improve
as_string()
representation forTypeVar
,ParamSpec
andTypeVarTuple
nodes, as well astype parameter in
ClassDef
,FuncDef
andTypeAlias
nodes (PEP 695).Astroid now correctly supports the
exceptions
attribute ofExceptionGroup
.Closes
not-an-iterable
false positive onExceptionGroup.exceptions
pylint#8985Closes False positive E1136 unsubscriptable-object on ExceptionGroup pylint#10558
Deprecate importing node classes from
astroid
directly. This will be removed in v5.It's recommended to import them from
astroid.nodes
instead.Refs Deprecate nodes import from astroid #2837