Skip to content

Commit 0dd9498

Browse files
Merge branch 'main' into pylint_issue_8897_enum_no_member
2 parents f232660 + ea78827 commit 0dd9498

Some content is hidden

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

73 files changed

+582
-347
lines changed

.github/workflows/backport.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ jobs:
2424
)
2525
)
2626
steps:
27-
- uses: tibdex/backport@2e217641d82d02ba0603f46b1aeedefb258890ac # v2.0.3
27+
- uses: tibdex/backport@9565281eda0731b1d20c4025c43339fb0a23812e # v2.0.4
2828
with:
2929
github_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/ci.yaml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
timeout-minutes: 20
2525
steps:
2626
- name: Check out code from GitHub
27-
uses: actions/checkout@v3.5.3
27+
uses: actions/checkout@v4.0.0
2828
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
2929
id: python
3030
uses: actions/setup-python@v4.7.0
@@ -39,7 +39,7 @@ jobs:
3939
'requirements_full.txt', 'requirements_minimal.txt') }}" >> $GITHUB_OUTPUT
4040
- name: Restore Python virtual environment
4141
id: cache-venv
42-
uses: actions/cache@v3.3.1
42+
uses: actions/cache@v3.3.2
4343
with:
4444
path: venv
4545
key: >-
@@ -59,7 +59,7 @@ jobs:
5959
hashFiles('.pre-commit-config.yaml') }}" >> $GITHUB_OUTPUT
6060
- name: Restore pre-commit environment
6161
id: cache-precommit
62-
uses: actions/cache@v3.3.1
62+
uses: actions/cache@v3.3.2
6363
with:
6464
path: ${{ env.PRE_COMMIT_CACHE }}
6565
key: >-
@@ -86,7 +86,7 @@ jobs:
8686
python-key: ${{ steps.generate-python-key.outputs.key }}
8787
steps:
8888
- name: Check out code from GitHub
89-
uses: actions/checkout@v3.5.3
89+
uses: actions/checkout@v4.0.0
9090
- name: Set up Python ${{ matrix.python-version }}
9191
id: python
9292
uses: actions/setup-python@v4.7.0
@@ -106,7 +106,7 @@ jobs:
106106
'requirements_full.txt', 'requirements_minimal.txt') }}" >> $GITHUB_OUTPUT
107107
- name: Restore Python virtual environment
108108
id: cache-venv
109-
uses: actions/cache@v3.3.1
109+
uses: actions/cache@v3.3.2
110110
with:
111111
path: venv
112112
key: >-
@@ -125,7 +125,7 @@ jobs:
125125
. venv/bin/activate
126126
pytest --cov
127127
- name: Upload coverage artifact
128-
uses: actions/upload-artifact@v3.1.2
128+
uses: actions/upload-artifact@v3.1.3
129129
with:
130130
name: coverage-linux-${{ matrix.python-version }}
131131
path: .coverage
@@ -145,7 +145,7 @@ jobs:
145145
# Workaround to set correct temp directory on Windows
146146
# https://github.com/actions/virtual-environments/issues/712
147147
- name: Check out code from GitHub
148-
uses: actions/checkout@v3.5.3
148+
uses: actions/checkout@v4.0.0
149149
- name: Set up Python ${{ matrix.python-version }}
150150
id: python
151151
uses: actions/setup-python@v4.7.0
@@ -160,7 +160,7 @@ jobs:
160160
'requirements_full.txt', 'requirements_minimal.txt') }}" >> $GITHUB_OUTPUT
161161
- name: Restore Python virtual environment
162162
id: cache-venv
163-
uses: actions/cache@v3.3.1
163+
uses: actions/cache@v3.3.2
164164
with:
165165
path: venv
166166
key: >-
@@ -179,7 +179,7 @@ jobs:
179179
. venv\\Scripts\\activate
180180
pytest --cov
181181
- name: Upload coverage artifact
182-
uses: actions/upload-artifact@v3.1.2
182+
uses: actions/upload-artifact@v3.1.3
183183
with:
184184
name: coverage-windows-${{ matrix.python-version }}
185185
path: .coverage
@@ -195,7 +195,7 @@ jobs:
195195
python-version: ["pypy3.8", "pypy3.10"]
196196
steps:
197197
- name: Check out code from GitHub
198-
uses: actions/checkout@v3.5.3
198+
uses: actions/checkout@v4.0.0
199199
- name: Set up Python ${{ matrix.python-version }}
200200
id: python
201201
uses: actions/setup-python@v4.7.0
@@ -210,7 +210,7 @@ jobs:
210210
}}" >> $GITHUB_OUTPUT
211211
- name: Restore Python virtual environment
212212
id: cache-venv
213-
uses: actions/cache@v3.3.1
213+
uses: actions/cache@v3.3.2
214214
with:
215215
path: venv
216216
key: >-
@@ -229,7 +229,7 @@ jobs:
229229
. venv/bin/activate
230230
pytest --cov
231231
- name: Upload coverage artifact
232-
uses: actions/upload-artifact@v3.1.2
232+
uses: actions/upload-artifact@v3.1.3
233233
with:
234234
name: coverage-pypy-${{ matrix.python-version }}
235235
path: .coverage
@@ -241,7 +241,7 @@ jobs:
241241
needs: ["tests-linux", "tests-windows", "tests-pypy"]
242242
steps:
243243
- name: Check out code from GitHub
244-
uses: actions/checkout@v3.5.3
244+
uses: actions/checkout@v4.0.0
245245
- name: Set up Python 3.11
246246
id: python
247247
uses: actions/setup-python@v4.7.0

.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@v3.5.3
49+
uses: actions/checkout@v4.0.0
5050

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

.github/workflows/release-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
timeout-minutes: 5
1414
steps:
1515
- name: Check out code from GitHub
16-
uses: actions/checkout@v3.5.3
16+
uses: actions/checkout@v4.0.0
1717
- name: Set up Python 3.9
1818
id: python
1919
uses: actions/setup-python@v4.7.0

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
url: https://pypi.org/project/astroid/
2121
steps:
2222
- name: Check out code from Github
23-
uses: actions/checkout@v3.5.3
23+
uses: actions/checkout@v4.0.0
2424
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
2525
id: python
2626
uses: actions/setup-python@v4.7.0

.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ repos:
1010
- id: end-of-file-fixer
1111
exclude: tests/testdata
1212
- repo: https://github.com/astral-sh/ruff-pre-commit
13-
rev: "v0.0.282"
13+
rev: "v0.0.290"
1414
hooks:
1515
- id: ruff
1616
exclude: tests/testdata
@@ -23,7 +23,7 @@ repos:
2323
exclude: tests/testdata|setup.py
2424
types: [python]
2525
- repo: https://github.com/asottile/pyupgrade
26-
rev: v3.10.1
26+
rev: v3.11.0
2727
hooks:
2828
- id: pyupgrade
2929
exclude: tests/testdata
@@ -34,7 +34,7 @@ repos:
3434
- id: black-disable-checker
3535
exclude: tests/test_nodes_lineno.py
3636
- repo: https://github.com/psf/black
37-
rev: 23.7.0
37+
rev: 23.9.1
3838
hooks:
3939
- id: black
4040
args: [--safe, --quiet]
@@ -54,7 +54,7 @@ repos:
5454
]
5555
exclude: tests/testdata|conf.py
5656
- repo: https://github.com/pre-commit/mirrors-mypy
57-
rev: v1.4.1
57+
rev: v1.5.1
5858
hooks:
5959
- id: mypy
6060
name: mypy
@@ -66,7 +66,7 @@ repos:
6666
additional_dependencies: ["types-typed-ast"]
6767
exclude: tests/testdata| # exclude everything, we're not ready
6868
- repo: https://github.com/pre-commit/mirrors-prettier
69-
rev: v3.0.1
69+
rev: v3.0.3
7070
hooks:
7171
- id: prettier
7272
args: [--prose-wrap=always, --print-width=88]

ChangeLog

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,10 @@ Release date: TBA
225225

226226
Closes pylint-dev/pylint#8897
227227

228+
* Fix false positives for ``no-member`` and ``invalid-name`` when using the ``_name_``, ``_value_`` and ``_ignore_`` sunders in Enums.
229+
230+
Closes pylint-dev/pylint#9015
231+
228232
* Fix inference of functions with ``@functools.lru_cache`` decorators without
229233
parentheses.
230234

@@ -330,6 +334,11 @@ Release date: 2023-03-06
330334

331335
Refs #1780
332336

337+
* ``max_inferable_values`` can now be set on ``AstroidManager`` instances, e.g. ``astroid.MANAGER``
338+
besides just the ``AstroidManager`` class itself.
339+
340+
Closes #2280
341+
333342
* ``Astroid`` now retrieves the default values of keyword only arguments and sets them on
334343
``Arguments.kw_defaults``.
335344

MANIFEST.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
11
include README.rst
2+
include requirements*.txt
3+
include tox.ini
4+
recursive-include tests *.py
5+
graft tests/testdata

astroid/__init__.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,10 @@
4242

4343
from astroid import raw_building
4444
from astroid.__pkginfo__ import __version__, version
45-
from astroid.astroid_manager import MANAGER
4645
from astroid.bases import BaseInstance, BoundMethod, Instance, UnboundMethod
4746
from astroid.brain.helpers import register_module_extender
4847
from astroid.builder import extract_node, parse
49-
from astroid.const import BRAIN_MODULES_DIRECTORY, PY310_PLUS, Context
48+
from astroid.const import PY310_PLUS, Context
5049
from astroid.exceptions import (
5150
AstroidBuildingError,
5251
AstroidBuildingException,
@@ -83,6 +82,7 @@
8382
# and we need astroid/scoped_nodes and astroid/node_classes to work. So
8483
# importing with a wildcard would clash with astroid/nodes/scoped_nodes
8584
# and astroid/nodes/node_classes.
85+
from astroid.astroid_manager import MANAGER
8686
from astroid.nodes import (
8787
CONST_CLS,
8888
AnnAssign,
@@ -186,8 +186,3 @@
186186
and getattr(tokenize._compile, "__wrapped__", None) is None # type: ignore[attr-defined]
187187
):
188188
tokenize._compile = functools.lru_cache(tokenize._compile) # type: ignore[attr-defined]
189-
190-
# load brain plugins
191-
for module in BRAIN_MODULES_DIRECTORY.iterdir():
192-
if module.suffix == ".py":
193-
import_module(f"astroid.brain.{module.stem}")

astroid/astroid_manager.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
# For details: https://github.com/pylint-dev/astroid/blob/main/LICENSE
1313
# Copyright (c) https://github.com/pylint-dev/astroid/blob/main/CONTRIBUTORS.txt
1414

15+
from astroid.brain.helpers import register_all_brains
1516
from astroid.manager import AstroidManager
1617

1718
MANAGER = AstroidManager()
19+
# Register all brains after instantiating the singleton Manager
20+
register_all_brains(MANAGER)

0 commit comments

Comments
 (0)