-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathpyproject.toml
More file actions
274 lines (262 loc) · 9.61 KB
/
pyproject.toml
File metadata and controls
274 lines (262 loc) · 9.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
[build-system]
build-backend = "setuptools.build_meta"
requires = [ "setuptools>=77" ]
[project]
name = "pylint"
description = "python code static checker"
readme = "README.rst"
keywords = [ "lint", "linter", "python", "static code analysis" ]
license = "GPL-2.0-OR-later"
license-files = [ "LICENSE", "CONTRIBUTORS.txt" ]
authors = [
{ name = "Python Code Quality Authority", email = "code-quality@python.org" },
]
requires-python = ">=3.10.0"
classifiers = [
"Development Status :: 6 - Mature",
"Environment :: Console",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Software Development :: Debuggers",
"Topic :: Software Development :: Quality Assurance",
"Topic :: Software Development :: Testing",
"Typing :: Typed",
]
dynamic = [ "version" ]
# All the dependencies of the project will be configured here, once pip fully supports PEP735
# TODO: Remove all requirements.txt files and use this section instead once pip supports PEP735
dependencies = [
# Also upgrade test-min dependency group and requirements_test_min.txt.
# Pinned to dev of second minor update to allow editable installs and fix primer issues,
# see https://github.com/pylint-dev/astroid/issues/1341
"astroid>=4.2.0b1,<=4.3",
"colorama>=0.4.5; sys_platform=='win32'",
"dill>=0.2; python_version<'3.11'",
"dill>=0.3.6; python_version>='3.11'",
"dill>=0.3.7; python_version>='3.12'",
"isort>=5,!=5.13,<9",
"mccabe>=0.6,<0.8",
"platformdirs>=2.2",
"tomli>=1.1; python_version<'3.11'",
"tomlkit>=0.10.1",
"typing-extensions>=3.10; python_version<'3.10'",
]
optional-dependencies.spelling = [ "pyenchant~=3.2" ]
optional-dependencies.testutils = [ "gitpython>3" ]
urls."Bug Tracker" = "https://github.com/pylint-dev/pylint/issues"
urls."Discord Server" = "https://discord.com/invite/Egy6P8AMB5"
urls."Docs: Contributor Guide" = "https://pylint.readthedocs.io/en/latest/development_guide/contributor_guide/index.html"
urls."Docs: User Guide" = "https://pylint.readthedocs.io/en/latest/"
urls."Source Code" = "https://github.com/pylint-dev/pylint"
urls."What's New" = "https://pylint.readthedocs.io/en/latest/whatsnew/4/"
urls.homepage = "https://github.com/pylint-dev/pylint"
scripts.pylint = "pylint:run_pylint"
scripts.pylint-config = "pylint:_run_pylint_config"
scripts.pyreverse = "pylint:run_pyreverse"
scripts.symilar = "pylint:run_symilar"
[dependency-groups]
dev = [
"contributors-txt>=1",
"pre-commit",
"tbump~=6.11.0",
]
test = [
"coverage~=7.10",
"pytest-cov>=6.2,<8",
"pytest-xdist~=3.8",
"six",
"tox>=3",
{ include-group = "test-min" },
]
docs = [
"furo==2025.12.19",
"sphinx==8.2.3",
"sphinx-reredirects<1",
"towncrier>=24.8,<26",
]
# Configuration for the build system
test-min = [
# Base test dependencies
"astroid==4.2.0b1", # Pinned to a specific version for tests
"py~=1.11.0",
"pytest>=8.4,<10",
"pytest-benchmark~=5.1",
"pytest-timeout~=2.4",
"requests",
"setuptools; python_version>='3.12'",
"towncrier>=24.8,<26",
"typing-extensions~=4.15",
]
[tool.setuptools]
dynamic.version = { attr = "pylint.__pkginfo__.__version__" }
package-data.pylint = [ "testutils/testing_pylintrc", "py.typed" ]
# Simulate editable_mode=compat, described at:
# https://github.com/pypa/setuptools/issues/3767
# TODO: remove after solving root cause described at:
# https://github.com/pylint-dev/astroid/pull/2267#issuecomment-1666642781
package-dir."" = "."
packages.find.include = [ "pylint*" ]
[tool.ruff]
# ruff is less lenient than pylint and does not make any exceptions
# (for docstrings, strings and comments in particular).
line-length = 115
extend-exclude = [
"tests/**/data/",
"tests/**/functional/",
"tests/input/",
"tests/regrtest_data/",
]
lint.select = [
"B", # bugbear
"D", # pydocstyle
"E", # pycodestyle
"F", # pyflakes
"I", # isort
"PIE", # flake8-pie
"PTH", # flake8-pathlib
"PYI", # flake8-pyi
"RUF", # ruff
"UP", # pyupgrade
"W", # pycodestyle
]
lint.ignore = [
"B905", # `zip()` without an explicit `strict=` parameter
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D104", # Missing docstring in public package
"D105", # Missing docstring in magic method
"D106", # Missing docstring in public nested class
"D107", # Missing docstring in `__init__`
"D205", # 1 blank line required between summary line and description
"D400", # First line should end with a period
"D401", # First line of docstring should be in imperative mood
"PTH100", # `os.path.abspath()` should be replaced by `Path.resolve()`
"PTH103", # `os.makedirs()` should be replaced by `Path.mkdir(parents=True)`
"PTH107", # `os.remove()` should be replaced by `Path.unlink()`
"PTH108", # `os.unlink()` should be replaced by `Path.unlink()`
"PTH109", # `os.getcwd()` should be replaced by `Path.cwd()`
"PTH110", # `os.path.exists()` should be replaced by `Path.exists()`
"PTH111", # `os.path.expanduser()` should be replaced by `Path.expanduser()`
"PTH112", # `os.path.isdir()` should be replaced by `Path.is_dir()`
"PTH113", # `os.path.isfile()` should be replaced by `Path.is_file()`
"PTH118", # `os.path.join()` should be replaced by `Path` with `/` operator
"PTH119", # `os.path.basename()` should be replaced by `Path.name`
"PTH120", # `os.path.dirname()` should be replaced by `Path.parent`
"PTH122", # `os.path.splitext()` should be replaced by `Path.suffix`, `Path.stem`, and `Path.parent`
"PTH123", # `open()` should be replaced by `Path.open()`
"PTH207", # Replace `glob` with `Path.glob` or `Path.rglob`
"PTH208", # Use `pathlib.Path.iterdir()` instead"
"RUF012", # mutable default values in class attributes
]
lint.pydocstyle.convention = "pep257"
[tool.isort]
profile = "black"
known_third_party = [ "platformdirs", "astroid", "sphinx", "isort", "pytest", "mccabe", "six", "toml" ]
extra_standard_library = [ "_string" ]
skip_glob = [
"tests/functional/**",
"tests/input/**",
"tests/extensions/data/**",
"tests/regrtest_data/**",
"tests/data/**",
"astroid/**",
"venv/**",
]
src_paths = [ "pylint" ]
[tool.codespell]
ignore-words = [ "custom_dict.txt" ]
# Disabled the spelling files for obvious reason, but also,
# the test file with typing extension imported as 'te' and:
# tests/functional/i/implicit/implicit_str_concat_latin1.py:
# - bad encoding
# pylint/pyreverse/diagrams.py and tests/pyreverse/test_diagrams.py:
# - An API from pyreverse use 'classe', and would need to be deprecated
# pylint/checkers/imports.py:
# - 'THIRDPARTY' is a value from isort that would need to be handled even
# if isort fix the typo in newer versions
# tests/functional/m/member/member_checks.py:
# - typos are voluntary to create credible 'no-member'
skip = """\
tests/checkers/unittest_spelling.py,CODE_OF_CONDUCT.md,CONTRIBUTORS.txt,pylint/checkers/imports.py,pylint/pyreverse/d\
iagrams.py,tests/pyreverse/test_diagrams.py,tests/functional/i/implicit/implicit_str_concat_latin1.py,tests/functiona\
l/m/member/member_checks.py,tests/functional/t/type/typevar_naming_style_rgx.py,tests/functional/t/type/typevar_namin\
g_style_default.py,tests/functional/m/member/member_checks_async.py,\
"""
[tool.pyproject-fmt]
max_supported_python = "3.14"
[tool.mypy]
scripts_are_modules = true
warn_unused_ignores = true
show_error_codes = true
enable_error_code = "ignore-without-code"
strict = true
# TODO: Remove this once pytest has annotations
disallow_untyped_decorators = false
[[tool.mypy.overrides]]
ignore_missing_imports = true
module = [
"_pytest.*",
"_string",
"astroid.*",
# `colorama` ignore is needed for Windows environment
"colorama",
"contributors_txt",
"coverage",
"dill",
"enchant.*",
"git.*",
"mccabe",
"pytest_benchmark.*",
"pytest",
"sphinx.*",
]
# For local tests: Enable follow_untyped_imports overwrite for astroid
# [[tool.mypy.overrides]]
# module = ["astroid.*"]
# follow_untyped_imports = true
[tool.pyright]
include = [
"pylint",
# not checking the tests yet, but we could
]
pythonVersion = "3.10"
typeCheckingMode = "basic"
reportMissingImports = "none" # pytest / astroid are not detected
reportOptionalMemberAccess = "none" # 150 issues
reportArgumentType = "none" # 12 issues
reportAttributeAccessIssue = "none" # 11 issues
reportInvalidTypeForm = "none" # 6 issues
reportOptionalCall = "none" # 2 issues
reportGeneralTypeIssues = "none" # 1 issue
reportCallIssue = "none" # 1 issue
reportInvalidTypeVarUse = "none" # 2 warnings
[tool.pytest]
ini_options.testpaths = [ "tests" ]
ini_options.python_files = [ "*test_*.py" ]
ini_options.addopts = "--strict-markers"
ini_options.filterwarnings = [
"error",
# Added in Python 3.14
"ignore:'break' in a 'finally' block:SyntaxWarning",
"ignore:'return' in a 'finally' block:SyntaxWarning",
"ignore:'continue' in a 'finally' block:SyntaxWarning",
]
ini_options.markers = [
"primer_stdlib: Checks for crashes and errors when running pylint on stdlib",
"benchmark: Baseline of pylint performance, if this regress something serious happened",
"timeout: Marks from pytest-timeout.",
"needs_two_cores: Checks that need 2 or more cores to be meaningful",
]
[tool.aliases]
test = "pytest"