Skip to content

Commit 8a198fa

Browse files
committed
Squashed commit of the following:
commit ba7df4a Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue Oct 1 10:30:42 2024 +0200 [pre-commit.ci] pre-commit autoupdate (pylint-dev#2593) updates: - [github.com/astral-sh/ruff-pre-commit: v0.6.7 → v0.6.8](astral-sh/ruff-pre-commit@v0.6.7...v0.6.8) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> commit 8620ae1 Author: Nick Drozd <[email protected]> Date: Mon Sep 30 15:14:25 2024 -0400 Enable design complexity checks (pylint-dev#2591) commit 36094ed Author: temyurchenko <[email protected]> Date: Mon Sep 30 15:14:13 2024 -0400 control setting nodes as local outside of the constructor (pylint-dev#2588) 1. The main reason is that a node might be assigned to its parent via an «alias»: Sometimes a class accesses a member by a different name than "__name__" of that member: in pypy3 `list.__mul__.__name__ == "__rmul__"`. As a result, in the example above we weren't able to find "list.__mul__", because it was recorded only as "list.__rmul__". 2. Sometimes we want to have a parent semantically, but we don't want to add it to the list of locals. For example, when inferring properties we are creating ad-hoc properties. We wouldn't want to add another symbol to the locals every time we do an inference. (actually, there's a very good question as to why we are doing those ad-hoc properties but that's out of scope) it's a part of the campaign to get rid of non-module roots commit 32cb29e Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon Sep 30 20:33:57 2024 +0200 Bump actions/checkout from 4.1.7 to 4.2.0 (pylint-dev#2592) Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.7 to 4.2.0. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@v4.1.7...v4.2.0) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> commit d394fb9 Author: Jacob Walls <[email protected]> Date: Mon Sep 30 08:52:35 2024 -0400 Bump astroid to 4.0.0-dev0, update changelog commit c7ea1e9 Author: correctmost <[email protected]> Date: Sat Sep 7 14:47:47 2024 -0400 Consolidate numpy member transforms to reduce function calls commit f19fc0a Author: Artem Yurchenko <[email protected]> Date: Thu Sep 26 19:56:45 2024 -0700 disable AsyncGeneratorModel from inheriting Generator attributes for example, usual generators have "send", but async don't. They have "async" instead. commit 62c5bad Author: temyurchenko <[email protected]> Date: Thu Sep 26 00:29:36 2024 -0400 change the type annotation error heuristic (pylint-dev#2583) The previous one depended on the message from "typed_ast", which is not used anymore. Instead, we check if there is a "# type:" substring in the source line of the exception. This can yield some false positives, but probably rarely. commit a3f5c4a Author: temyurchenko <[email protected]> Date: Wed Sep 25 16:18:58 2024 -0400 wrap GeneratorModel methods into BoundMethod; remove redundant test (pylint-dev#2584) The LookupTest.test_generator_attributes contains outdated Python 2 code (doesn't run on Python 3). The test is superceded by GeneratorModelTest.test_model. Fix AsyncGenerator test and model, they just weren't used before commit eb88dfe Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue Sep 24 06:47:29 2024 +0200 [pre-commit.ci] pre-commit autoupdate (pylint-dev#2582) updates: - [github.com/astral-sh/ruff-pre-commit: v0.6.5 → v0.6.7](astral-sh/ruff-pre-commit@v0.6.5...v0.6.7) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> commit c8e8831 Merge: 8585ce6 498cf96 Author: Jacob Walls <[email protected]> Date: Mon Sep 23 14:33:13 2024 -0400 Merge pull request pylint-dev#2581 from pylint-dev/post-3.3.4 Post 3.3.4 commit 498cf96 Merge: 8585ce6 6042e58 Author: Jacob Walls <[email protected]> Date: Mon Sep 23 14:25:58 2024 -0400 Merge branch 'maintenance/3.3.x' into post-3.3.4 commit 8585ce6 Author: Eric Vergnaud <[email protected]> Date: Mon Sep 23 19:53:55 2024 +0200 Fix issue when inferring single-node or non-const JoinedStr (pylint-dev#2578) commit 706fcdb Author: Jacob Walls <[email protected]> Date: Sun Sep 22 09:14:31 2024 -0400 Address pylint 3.3 messages (pylint-dev#2575) commit a679550 Author: Nick Drozd <[email protected]> Date: Sun Sep 22 09:00:09 2024 -0400 Check for empty format specs (pylint-dev#2574) commit 58286a1 Author: Akhil Kamat <[email protected]> Date: Sat Sep 21 21:36:35 2024 -0400 Fix `manager.clear_cache()` not fully clearing the module cache (pylint-dev#2572) commit 1368be1 Merge: 5a93a9f 11db16d Author: Jacob Walls <[email protected]> Date: Fri Sep 20 08:10:58 2024 -0300 Merge pull request pylint-dev#2570 from pylint-dev/post-3.3.3 Post 3.3.3 commit 11db16d Merge: 5a93a9f a01a9c9 Author: Jacob Walls <[email protected]> Date: Fri Sep 20 06:46:12 2024 -0400 Merge branch 'maintenance/3.3.x' into post-3.3.3 commit 5a93a9f Author: Jacob Walls <[email protected]> Date: Thu Sep 19 09:43:50 2024 -0300 Fix inference regression with property setters (pylint-dev#2567) Closes pylint-dev/pylint#9811 commit 826d477 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu Sep 19 12:05:44 2024 +0000 Bump actions/upload-artifact from 4.3.6 to 4.4.0 (pylint-dev#2533) Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.3.6 to 4.4.0. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](actions/upload-artifact@v4.3.6...v4.4.0) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> commit 709f991 Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue Sep 17 07:04:26 2024 +0200 [pre-commit.ci] pre-commit autoupdate (pylint-dev#2565) updates: - [github.com/astral-sh/ruff-pre-commit: v0.6.4 → v0.6.5](astral-sh/ruff-pre-commit@v0.6.4...v0.6.5) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> commit a99967e Author: temyurchenko <[email protected]> Date: Fri Sep 13 11:35:02 2024 -0400 Require build class parent (pylint-dev#2557) * enforce a non-None parent in build_class We also remove `add_local_node` to avoid redundancy. Instead we do the attachment to the parent scope in the constructor of `ClassDef`. We append a node to the body of the frame when it is also the parent. If it's not a parent, then the node should belong to the "body" of the parent if it existed. An example is a definition within an "if", where the parent is the If node, but the frame is the whole module. it's a part of the campaign to get rid of non-module roots commit c7b8a2f Author: akamat10 <[email protected]> Date: Mon Sep 9 18:17:02 2024 -0400 add setuptools dependency for python >= 3.12 commit 44907c2 Author: akamat10 <[email protected]> Date: Mon Sep 9 18:16:37 2024 -0400 Remove setuptools dependency from ci commit b4ac0e2 Author: Akhil Kamat <[email protected]> Date: Wed Sep 11 06:06:28 2024 -0400 Remove newstyle variable given old-style class support should be removed (pylint-dev#2561) commit 523eeb4 Author: temyurchenko <[email protected]> Date: Wed Sep 11 04:53:30 2024 -0400 Fix unexpected `__doc__` values (pylint-dev#2556) * fix unexpected '__doc__' values some '__doc__' fields of standard library symbols (e.g. WrapperDescriptorType.__doc__) don't return a string, they return a 'getset_descriptor'. Thus, an attempt to print "as string" fails. The solution is to check that __doc__ is an instance of str. Note that it wasn't uncovered by the tests due to classes not being attached to their parent in some cases. This is be done in one of the subsequent commits. it's a part of the campaign to get rid of non-module roots * put the "temporary_class" for the metaclass hack into adhoc module it's a part of the campaign to get rid of non-module roots commit e442776 Author: Artem Yurchenko <[email protected]> Date: Mon Sep 9 11:31:27 2024 -0700 set PartialFunction's parent to adhoc module instead of Unknown it's a part of the campaign to get rid of non-module roots commit 8364693 Author: temyurchenko <[email protected]> Date: Tue Sep 10 15:32:07 2024 -0400 Fix in place properties (pylint-dev#2553) * fix construction of in-place properties This is an example of an in-place property: `bar = property(getter)`. They just create a nameless object, not the one with the name of the getter. Thus, the name was changed to "<property>". Furthermore, the definition of that property is not attached to any scope, as it's again nameless. it's a part of the campaign to get rid of non-module roots commit 20890b8 Author: Artem Yurchenko <[email protected]> Date: Mon Sep 9 11:12:33 2024 -0700 set namespace's parent to adhoc module instead of Unknown it's a part of the campaign to get rid of non-module roots commit b6d52d3 Author: Artem Yurchenko <[email protected]> Date: Mon Sep 9 11:04:34 2024 -0700 create an "adhoc" module for "artificial" nodes the module is specifically for nodes that are not based in the real syntactic tree, but created "ad-hoc", for example, new namedtuple classes that we create (see brain_namedtuple_enum). This is the base for future changes on replacing non-module roots (with the adhoc module or something more approriate). commit 6ec2d40 Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue Sep 10 06:15:01 2024 +0200 [pre-commit.ci] pre-commit autoupdate (pylint-dev#2559) updates: - [github.com/astral-sh/ruff-pre-commit: v0.6.3 → v0.6.4](astral-sh/ruff-pre-commit@v0.6.3...v0.6.4) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> commit 0011e7f Author: Artem Yurchenko <[email protected]> Date: Tue Sep 3 16:12:12 2024 -0700 add the parent node to "__main__" Not having a parent leads to weird situations, like `root()` returning the node itself, not a `Module`. commit 7954bac Author: correctmost <[email protected]> Date: Sat Sep 7 11:52:56 2024 -0400 Fix most of the mypy errors in astroid/nodes/as_string.py commit 8573b68 Author: correctmost <[email protected]> Date: Sun Sep 8 03:15:01 2024 -0400 Fix useless-suppression Pylint warning (pylint-dev#2548) * Bump Pylint requirement to 3.2.7 commit cae2977 Author: correctmost <[email protected]> Date: Sun Sep 8 00:59:25 2024 -0400 Add .tox to Pylint ignore list (pylint-dev#2549) commit 887668b Author: correctmost <[email protected]> Date: Sat Sep 7 02:37:50 2024 -0400 Fix additional mypy errors and expand CI checks to more files (pylint-dev#2541) * Fix additional mypy errors and expand CI checks to more files * Use an assertion instead of a type ignore * Move an assert outside of a type-checking block commit ba331c0 Author: correctmost <[email protected]> Date: Sat Sep 7 02:09:11 2024 -0400 Use extend-exclude instead of exclude in ruff config (pylint-dev#2545) The ruff docs recommend using extend-exclude for custom paths. commit 003a2df Author: correctmost <[email protected]> Date: Sat Sep 7 00:47:03 2024 -0400 Remove Python 3.8 from tox config (pylint-dev#2546) commit dc5dafb Author: correctmost <[email protected]> Date: Fri Sep 6 01:37:53 2024 -0400 Avoid extra isinstance calls in _builtin_filter_predicate (pylint-dev#2544) commit 5982618 Author: correctmost <[email protected]> Date: Thu Sep 5 15:29:25 2024 -0400 Move Pylint exclusions to pylintrc (pylint-dev#2542) This makes it easier to run Pylint outside of the pre-commit hooks. commit 71f5c0c Author: correctmost <[email protected]> Date: Wed Sep 4 10:55:41 2024 -0400 Do not reassign submodule_path parameters in method bodies This makes it easier to use less generic annotations with mypy. commit 1495979 Author: correctmost <[email protected]> Date: Wed Sep 4 10:34:55 2024 -0400 Fix type annotations for tuple parameters commit 6deb34f Author: correctmost <[email protected]> Date: Wed Sep 4 02:04:09 2024 -0400 Add ruff exclusions to pyproject.toml (pylint-dev#2537) This makes it easier to run 'ruff check' outside of the pre-commit hook. Co-authored-by: Pierre Sassoulas <[email protected]> commit 78f7f60 Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue Sep 3 08:52:20 2024 +0200 [pre-commit.ci] pre-commit autoupdate (pylint-dev#2535) updates: - [github.com/astral-sh/ruff-pre-commit: v0.6.2 → v0.6.3](astral-sh/ruff-pre-commit@v0.6.2...v0.6.3) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> commit a30794c Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon Sep 2 20:09:47 2024 +0200 Bump actions/setup-python from 5.1.1 to 5.2.0 (pylint-dev#2534) Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5.1.1 to 5.2.0. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](actions/setup-python@v5.1.1...v5.2.0) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> commit 37b6c0d Author: temyurchenko <[email protected]> Date: Fri Aug 30 17:30:56 2024 -0400 fix the documentation and the error message of modpath_from_file (pylint-dev#2532) The doc should clarify that the search will always include sys.path. The error message should reflect the actual paths used for checking. commit 5210e61 Author: correctmost <[email protected]> Date: Fri Aug 30 09:00:26 2024 -0400 Enable mypy checking for astroid/interpreter/_import/ (pylint-dev#2530) This commit also removes unnecessary tuple -> list conversions in _find_spec. commit a389ef7 Author: correctmost <[email protected]> Date: Tue Aug 27 17:19:26 2024 -0400 Use a tuple for processed parameter to facilitate future caching (pylint-dev#2529) commit 16990fc Author: correctmost <[email protected]> Date: Tue Aug 27 16:25:48 2024 -0400 Remove unnecessary isinstance calls from transform predicates (pylint-dev#2507) commit 0cf9a2e Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue Aug 27 06:34:11 2024 +0200 [pre-commit.ci] pre-commit autoupdate (pylint-dev#2528) updates: - [github.com/astral-sh/ruff-pre-commit: v0.6.1 → v0.6.2](astral-sh/ruff-pre-commit@v0.6.1...v0.6.2) - [github.com/pre-commit/mirrors-mypy: v1.11.1 → v1.11.2](pre-commit/mirrors-mypy@v1.11.1...v1.11.2) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> commit d8dbc46 Author: correctmost <[email protected]> Date: Sun Aug 25 21:53:58 2024 -0400 Use a tuple for module_parts parameter to facilitate future caching commit f924ba2 Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue Aug 20 06:15:34 2024 +0200 [pre-commit.ci] pre-commit autoupdate (pylint-dev#2512) updates: - [github.com/astral-sh/ruff-pre-commit: v0.5.7 → v0.6.1](astral-sh/ruff-pre-commit@v0.5.7...v0.6.1) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> commit b312b56 Author: correctmost <[email protected]> Date: Sun Aug 18 04:49:15 2024 +0000 Make Finder.find_module static to facilitate future caching (pylint-dev#2509) commit 8515010 Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue Aug 13 06:19:18 2024 +0200 [pre-commit.ci] pre-commit autoupdate (pylint-dev#2510) updates: - [github.com/astral-sh/ruff-pre-commit: v0.5.6 → v0.5.7](astral-sh/ruff-pre-commit@v0.5.6...v0.5.7) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> commit fa32673 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon Aug 12 22:35:41 2024 +0200 Bump actions/upload-artifact from 4.3.5 to 4.3.6 (pylint-dev#2508) Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.3.5 to 4.3.6. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](actions/upload-artifact@v4.3.5...v4.3.6) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> commit 5e8fac7 Author: correctmost <[email protected]> Date: Sun Aug 11 17:41:02 2024 +0000 Add cached version of os.path.isfile to avoid repetitive I/O (pylint-dev#2501) commit 3a743a4 Merge: 5b838f2 4df8708 Author: Jacob Walls <[email protected]> Date: Sun Aug 11 10:18:28 2024 -0400 Merge pull request pylint-dev#2506 from pylint-dev/post-3.3.2 Post 3.3.2 commit 4df8708 Merge: 86c7871 4ae4617 Author: Jacob Walls <[email protected]> Date: Sun Aug 11 08:02:12 2024 -0400 Merge branch 'maintenance/3.3.x' into post-3.3.2 commit 5b838f2 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun Aug 11 13:50:27 2024 +0200 Update sphinx requirement from ~=7.4 to ~=8.0 (pylint-dev#2494) * Update sphinx requirement from ~=7.4 to ~=8.0 Updates the requirements on [sphinx](https://github.com/sphinx-doc/sphinx) to permit the latest version. - [Release notes](https://github.com/sphinx-doc/sphinx/releases) - [Changelog](https://github.com/sphinx-doc/sphinx/blob/v8.0.2/CHANGES.rst) - [Commits](sphinx-doc/sphinx@v7.4.0...v8.0.2) --- updated-dependencies: - dependency-name: sphinx dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> * Upgrade furo too --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Pierre Sassoulas <[email protected]> commit 86c7871 Author: Jacob Walls <[email protected]> Date: Sat Aug 10 17:06:09 2024 -0400 [PY313] Add stubs for soft-deprecated typing members (pylint-dev#2503) commit 0156c04 Author: correctmost <[email protected]> Date: Wed Aug 7 11:57:49 2024 +0000 Avoid overhead of cast() calls when not type checking (pylint-dev#2500) commit 29b6cbd Author: correctmost <[email protected]> Date: Wed Aug 7 11:48:42 2024 +0000 Avoid extra isinstance calls in _visit_generic (pylint-dev#2502) commit 15207a7 Merge: 04f4f3f 996ffea Author: Jacob Walls <[email protected]> Date: Tue Aug 6 09:52:55 2024 -0400 Merge pull request pylint-dev#2499 from pylint-dev/post-3.3.1 commit 996ffea Merge: 04f4f3f de58003 Author: Jacob Walls <[email protected]> Date: Tue Aug 6 09:05:54 2024 -0400 Merge branch 'maintenance/3.3.x' into post-3.3.1 commit 04f4f3f Author: Eric Vergnaud <[email protected]> Date: Tue Aug 6 13:59:28 2024 +0200 Fix pylint regression with invalid format strings (pylint-dev#2496) Catch exceptions when calling string.format commit 8d3cdbb Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon Aug 5 20:06:08 2024 -0400 [pre-commit.ci] pre-commit autoupdate (pylint-dev#2495) updates: - [github.com/astral-sh/ruff-pre-commit: v0.5.5 → v0.5.6](astral-sh/ruff-pre-commit@v0.5.5...v0.5.6) - [github.com/psf/black: 24.4.2 → 24.8.0](psf/black@24.4.2...24.8.0) - [github.com/pre-commit/mirrors-mypy: v1.11.0 → v1.11.1](pre-commit/mirrors-mypy@v1.11.0...v1.11.1) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> commit 61dba89 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon Aug 5 23:27:45 2024 +0200 Bump actions/upload-artifact from 4.3.4 to 4.3.5 (pylint-dev#2493) Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.3.4 to 4.3.5. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](actions/upload-artifact@v4.3.4...v4.3.5) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> commit b105186 Author: Jacob Walls <[email protected]> Date: Sun Aug 4 09:10:21 2024 -0400 Bump astroid to 3.4.0-dev0, update changelog
1 parent 8c74a5f commit 8a198fa

File tree

86 files changed

+583
-582
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+583
-582
lines changed

.github/workflows/ci.yaml

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ jobs:
2424
timeout-minutes: 20
2525
steps:
2626
- name: Check out code from GitHub
27-
uses: actions/checkout@v4.1.7
27+
uses: actions/checkout@v4.2.0
2828
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
2929
id: python
30-
uses: actions/setup-python@v5.1.1
30+
uses: actions/setup-python@v5.2.0
3131
with:
3232
python-version: ${{ env.DEFAULT_PYTHON }}
3333
check-latest: true
@@ -86,10 +86,10 @@ jobs:
8686
python-key: ${{ steps.generate-python-key.outputs.key }}
8787
steps:
8888
- name: Check out code from GitHub
89-
uses: actions/checkout@v4.1.7
89+
uses: actions/checkout@v4.2.0
9090
- name: Set up Python ${{ matrix.python-version }}
9191
id: python
92-
uses: actions/setup-python@v5.1.1
92+
uses: actions/setup-python@v5.2.0
9393
with:
9494
python-version: ${{ matrix.python-version }}
9595
check-latest: true
@@ -117,18 +117,19 @@ jobs:
117117
run: |
118118
python -m venv venv
119119
. venv/bin/activate
120-
python -m pip install -U pip setuptools wheel
120+
python -m pip install -U pip wheel
121121
pip install -U -r requirements_full.txt
122122
pip install -e .
123123
- name: Run pytest
124124
run: |
125125
. venv/bin/activate
126126
pytest --cov
127127
- name: Upload coverage artifact
128-
uses: actions/upload-artifact@v4.3.4
128+
uses: actions/upload-artifact@v4.4.0
129129
with:
130130
name: coverage-linux-${{ matrix.python-version }}
131131
path: .coverage
132+
include-hidden-files: true
132133

133134
tests-windows:
134135
name: tests / run / ${{ matrix.python-version }} / Windows
@@ -145,10 +146,10 @@ jobs:
145146
# Workaround to set correct temp directory on Windows
146147
# https://github.com/actions/virtual-environments/issues/712
147148
- name: Check out code from GitHub
148-
uses: actions/checkout@v4.1.7
149+
uses: actions/checkout@v4.2.0
149150
- name: Set up Python ${{ matrix.python-version }}
150151
id: python
151-
uses: actions/setup-python@v5.1.1
152+
uses: actions/setup-python@v5.2.0
152153
with:
153154
python-version: ${{ matrix.python-version }}
154155
check-latest: true
@@ -179,10 +180,11 @@ jobs:
179180
. venv\\Scripts\\activate
180181
pytest --cov
181182
- name: Upload coverage artifact
182-
uses: actions/upload-artifact@v4.3.4
183+
uses: actions/upload-artifact@v4.4.0
183184
with:
184185
name: coverage-windows-${{ matrix.python-version }}
185186
path: .coverage
187+
include-hidden-files: true
186188

187189
tests-pypy:
188190
name: tests / run / ${{ matrix.python-version }} / Linux
@@ -195,10 +197,10 @@ jobs:
195197
python-version: ["pypy3.9", "pypy3.10"]
196198
steps:
197199
- name: Check out code from GitHub
198-
uses: actions/checkout@v4.1.7
200+
uses: actions/checkout@v4.2.0
199201
- name: Set up Python ${{ matrix.python-version }}
200202
id: python
201-
uses: actions/setup-python@v5.1.1
203+
uses: actions/setup-python@v5.2.0
202204
with:
203205
python-version: ${{ matrix.python-version }}
204206
check-latest: true
@@ -229,10 +231,11 @@ jobs:
229231
. venv/bin/activate
230232
pytest --cov
231233
- name: Upload coverage artifact
232-
uses: actions/upload-artifact@v4.3.4
234+
uses: actions/upload-artifact@v4.4.0
233235
with:
234236
name: coverage-pypy-${{ matrix.python-version }}
235237
path: .coverage
238+
include-hidden-files: true
236239

237240
coverage:
238241
name: tests / process / coverage
@@ -241,10 +244,10 @@ jobs:
241244
needs: ["tests-linux", "tests-windows", "tests-pypy"]
242245
steps:
243246
- name: Check out code from GitHub
244-
uses: actions/checkout@v4.1.7
247+
uses: actions/checkout@v4.2.0
245248
- name: Set up Python 3.12
246249
id: python
247-
uses: actions/setup-python@v5.1.1
250+
uses: actions/setup-python@v5.2.0
248251
with:
249252
python-version: "3.12"
250253
check-latest: true

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646

4747
steps:
4848
- name: Checkout repository
49-
uses: actions/checkout@v4.1.7
49+
uses: actions/checkout@v4.2.0
5050

5151
# Initializes the CodeQL tools for scanning.
5252
- name: Initialize CodeQL

.github/workflows/release-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ jobs:
1313
timeout-minutes: 5
1414
steps:
1515
- name: Check out code from GitHub
16-
uses: actions/checkout@v4.1.7
16+
uses: actions/checkout@v4.2.0
1717
- name: Set up Python 3.9
1818
id: python
19-
uses: actions/setup-python@v5.1.1
19+
uses: actions/setup-python@v5.2.0
2020
with:
2121
# virtualenv 15.1.0 cannot be installed on Python 3.10+
2222
python-version: 3.9

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ jobs:
2020
url: https://pypi.org/project/astroid/
2121
steps:
2222
- name: Check out code from Github
23-
uses: actions/checkout@v4.1.7
23+
uses: actions/checkout@v4.2.0
2424
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
2525
id: python
26-
uses: actions/setup-python@v5.1.1
26+
uses: actions/setup-python@v5.2.0
2727
with:
2828
python-version: ${{ env.DEFAULT_PYTHON }}
2929
check-latest: true

.pre-commit-config.yaml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@ repos:
1010
- id: end-of-file-fixer
1111
exclude: tests/testdata
1212
- repo: https://github.com/astral-sh/ruff-pre-commit
13-
rev: "v0.5.5"
13+
rev: "v0.6.8"
1414
hooks:
1515
- id: ruff
16-
exclude: tests/testdata
1716
args: ["--fix"]
1817
- repo: https://github.com/Pierre-Sassoulas/copyright_notice_precommit
1918
rev: 0.1.2
@@ -34,7 +33,7 @@ repos:
3433
- id: black-disable-checker
3534
exclude: tests/test_nodes_lineno.py
3635
- repo: https://github.com/psf/black
37-
rev: 24.4.2
36+
rev: 24.8.0
3837
hooks:
3938
- id: black
4039
args: [--safe, --quiet]
@@ -53,19 +52,14 @@ repos:
5352
"--output-format=github",
5453
# "--load-plugins=pylint.extensions.docparams", We're not ready for that
5554
]
56-
exclude: tests/testdata|conf.py
5755
- repo: https://github.com/pre-commit/mirrors-mypy
58-
rev: v1.11.0
56+
rev: v1.11.2
5957
hooks:
6058
- id: mypy
61-
name: mypy
62-
entry: mypy
6359
language: python
64-
types: [python]
65-
args: []
60+
pass_filenames: false
6661
require_serial: true
6762
additional_dependencies: ["types-typed-ast"]
68-
exclude: tests/testdata| # exclude everything, we're not ready
6963
- repo: https://github.com/pre-commit/mirrors-prettier
7064
rev: v4.0.0-alpha.8
7165
hooks:

ChangeLog

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ astroid's ChangeLog
33
===================
44

55

6-
What's New in astroid 3.4.0?
6+
What's New in astroid 4.0.0?
77
============================
88
Release date: TBA
99

@@ -13,6 +13,9 @@ What's New in astroid 3.3.6?
1313
============================
1414
Release date: TBA
1515

16+
* Control setting local nodes outside of the supposed local's constructor.
17+
18+
Closes pylint-dev/astroid/issues/1490
1619

1720

1821
What's New in astroid 3.3.5?
@@ -36,7 +39,7 @@ Release date: 2024-09-23
3639

3740
Closes pylint-dev/pylint#9947
3841

39-
* Fix bug with ``manager.clear_cache()`` not fully clearing cache
42+
* Fix bug with ``manager.clear_cache()`` not fully clearing cache.
4043

4144
Refs https://github.com/pylint-dev/pylint/pull/9932#issuecomment-2364985551
4245

astroid/__pkginfo__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
# For details: https://github.com/pylint-dev/astroid/blob/main/LICENSE
33
# Copyright (c) https://github.com/pylint-dev/astroid/blob/main/CONTRIBUTORS.txt
44

5-
__version__ = "3.3.5"
5+
__version__ = "4.0.0-dev0"
66
version = __version__

astroid/_ast.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def parse(
3232

3333
def parse_function_type_comment(type_comment: str) -> FunctionType | None:
3434
"""Given a correct type comment, obtain a FunctionType object."""
35-
func_type = ast.parse(type_comment, "<type_comment>", "func_type") # type: ignore[attr-defined]
35+
func_type = ast.parse(type_comment, "<type_comment>", "func_type")
3636
return FunctionType(argtypes=func_type.argtypes, returns=func_type.returns)
3737

3838

astroid/arguments.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def __init__(
5454
}
5555

5656
@classmethod
57-
def from_call(cls, call_node, context: InferenceContext | None = None):
57+
def from_call(cls, call_node: nodes.Call, context: InferenceContext | None = None):
5858
"""Get a CallSite object from the given Call node.
5959
6060
context will be used to force a single inference path.
@@ -65,7 +65,7 @@ def from_call(cls, call_node, context: InferenceContext | None = None):
6565
callcontext = CallContext(call_node.args, call_node.keywords)
6666
return cls(callcontext, context=context)
6767

68-
def has_invalid_arguments(self):
68+
def has_invalid_arguments(self) -> bool:
6969
"""Check if in the current CallSite were passed *invalid* arguments.
7070
7171
This can mean multiple things. For instance, if an unpacking
@@ -89,7 +89,7 @@ def _unpack_keywords(
8989
self,
9090
keywords: list[tuple[str | None, nodes.NodeNG]],
9191
context: InferenceContext | None = None,
92-
):
92+
) -> dict[str | None, InferenceResult]:
9393
values: dict[str | None, InferenceResult] = {}
9494
context = context or InferenceContext()
9595
context.extra_context = self.argument_context_map
@@ -142,6 +142,8 @@ def infer_argument(
142142
self, funcnode: InferenceResult, name: str, context: InferenceContext
143143
): # noqa: C901
144144
"""Infer a function argument value according to the call context."""
145+
# pylint: disable = too-many-branches
146+
145147
if not isinstance(funcnode, (nodes.FunctionDef, nodes.Lambda)):
146148
raise InferenceError(
147149
f"Can not infer function argument value for non-function node {funcnode!r}.",

astroid/bases.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ class Generator(BaseInstance):
679679
# We defer initialization of special_attributes to the __init__ method since the constructor
680680
# of GeneratorModel requires the raw_building to be complete
681681
# TODO: This should probably be refactored.
682-
special_attributes: objectmodel.GeneratorModel
682+
special_attributes: objectmodel.GeneratorBaseModel
683683

684684
def __init__(
685685
self,
@@ -718,6 +718,10 @@ def __str__(self) -> str:
718718
class AsyncGenerator(Generator):
719719
"""Special node representing an async generator."""
720720

721+
def __init__(self, *args, **kwargs):
722+
super().__init__(*args, **kwargs)
723+
AsyncGenerator.special_attributes = objectmodel.AsyncGeneratorModel()
724+
721725
def pytype(self) -> Literal["builtins.async_generator"]:
722726
return "builtins.async_generator"
723727

astroid/brain/brain_argparse.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44

55
from __future__ import annotations
66

7-
from astroid import arguments, inference_tip, nodes
7+
from astroid import arguments, nodes
88
from astroid.context import InferenceContext
99
from astroid.exceptions import UseInferenceDefault
10+
from astroid.inference_tip import inference_tip
1011
from astroid.manager import AstroidManager
1112

1213

@@ -20,13 +21,10 @@ def infer_namespace(node, context: InferenceContext | None = None):
2021
"Namespace",
2122
lineno=node.lineno,
2223
col_offset=node.col_offset,
23-
parent=nodes.Unknown(),
24+
parent=AstroidManager().adhoc_module, # this class is not real
2425
end_lineno=node.end_lineno,
2526
end_col_offset=node.end_col_offset,
2627
)
27-
# Set parent manually until ClassDef constructor fixed:
28-
# https://github.com/pylint-dev/astroid/issues/1490
29-
class_node.parent = node.parent
3028
for attr in set(callsite.keyword_arguments):
3129
fake_node = nodes.EmptyNode()
3230
fake_node.parent = class_node

astroid/brain/brain_boto3.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44

55
"""Astroid hooks for understanding ``boto3.ServiceRequest()``."""
66

7-
from astroid import extract_node
7+
from astroid.builder import extract_node
88
from astroid.manager import AstroidManager
99
from astroid.nodes.scoped_nodes import ClassDef
1010

1111
BOTO_SERVICE_FACTORY_QUALIFIED_NAME = "boto3.resources.base.ServiceResource"
1212

1313

14-
def service_request_transform(node):
14+
def service_request_transform(node: ClassDef) -> ClassDef:
1515
"""Transform ServiceResource to look like dynamic classes."""
1616
code = """
1717
def __getattr__(self, attr):
@@ -22,7 +22,7 @@ def __getattr__(self, attr):
2222
return node
2323

2424

25-
def _looks_like_boto3_service_request(node) -> bool:
25+
def _looks_like_boto3_service_request(node: ClassDef) -> bool:
2626
return node.qname() == BOTO_SERVICE_FACTORY_QUALIFIED_NAME
2727

2828

0 commit comments

Comments
 (0)