Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
212 lines (194 loc) · 5.65 KB
/
Copy pathpyproject.toml
File metadata and controls
212 lines (194 loc) · 5.65 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
[project]
name = "isort"
dynamic = ["version"]
description = "A Python utility / library to sort Python imports."
authors = [{name = "Daniël van Noord", email = "13665637+DanielNoord@users.noreply.github.com"}, {name = "Timothy Crosley", email = "timothy.crosley@gmail.com"}, {name = "staticdev", email = "staticdev-support@proton.me"}]
license = "MIT"
readme = "README.md"
repository = "https://github.com/pycqa/isort"
homepage = "https://isort.readthedocs.io//"
documentation = "https://isort.readthedocs.io/"
keywords = ["Refactor", "Lint", "Imports", "Sort", "Clean"]
classifiers = [
"Development Status :: 6 - Mature",
"Intended Audience :: Developers",
"Natural Language :: English",
"Environment :: Console",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: 3.15",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Software Development :: Libraries",
"Topic :: Utilities",
]
include = [
{ path = "tests", format = "sdist" },
{ path = "ACKNOWLEDGEMENTS.md", format = "sdist" },
{ path = "LICENSE", format = "sdist" },
]
requires-python = ">=3.11.0"
dependencies = [
"mypy-extensions>=1.1.0",
]
[project.urls]
Homepage = "https://isort.readthedocs.io/"
Documentation = "https://isort.readthedocs.io/"
Repository = "https://github.com/PyCQA/isort"
Changelog = "https://github.com/PyCQA/isort/releases"
[tool.hatch.version]
source = "vcs"
[tool.hatch.version.raw-options]
local_scheme = "no-local-version"
[project.scripts]
isort = "isort.main:main"
isort-identify-imports = "isort.main:identify_imports_main"
[project.optional-dependencies]
colors = ["colorama"]
[tool.coverage.paths]
source = [
"isort/",
".tox/*/lib/python*/site-packages/isort/",
".tox/*/lib/site-packages/isort/"
]
tests = ["tests", "*/tests"]
[tool.coverage.run]
branch = true
parallel = true
source = ["isort", "tests"]
omit = [
"tests/*",
]
[tool.coverage.report]
show_missing = true
fail_under = 99
exclude_lines = [
"pragma: no cover",
"except ImportError:",
"if TYPE_CHECKING:",
"if __name__ == .__main__.:",
"raise NotImplementedError",
]
[build-system]
requires = ["hatchling", "hatch-vcs", "hatch-mypyc"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel.hooks.mypyc]
# To allow local development without compilation after each change. Force compilation with:
# `HATCH_BUILD_HOOK_ENABLE_MYPYC=true uv sync --reinstall`
enable-by-default = false
dependencies = [
"hatch-mypyc",
"mypy",
"types-colorama>=0.4.2",
]
exclude = [
# Keep `python -m isort` working in mypyc wheels.
"isort/__main__.py",
# We rely on `__dict__` to make Exceptions pickable, mypyc removes this attribute.
"isort/exceptions.py"
]
[dependency-groups]
dev = [
"bandit>=1.8.6",
"black>=25.9.0",
"colorama>=0.4.6",
"coverage[toml]>=7.10.7",
"example-isort-sorting-plugin>=0.1.0",
"example-shared-isort-profile>=0.1.0",
"flake8>=7.3.0",
"flake8-bugbear>=24.12.12",
"flake8-pyproject>=1.2.3",
"hatch>=1.14.0",
"hypothesis>=6.140.3",
"hypothesmith>=0.3.3",
"libcst>=1.9.0",
"mypy>=2.3.1",
"pep8-naming>=0.15.1",
"pytest>=8.4.2",
"pytest-benchmark>=5.1.0",
"ruff>=0.13.3",
"stdlibs>=2026.2.26",
"tox>=4.30.3",
"tox-uv>=1.28.0",
"types-colorama>=0.4.2",
"uv>=0.8.23",
]
docs = [
"myst-parser>=4.0.1",
"sphinx>=7.4.7",
"sphinx-immaterial>=0.13.9",
]
[tool.flake8]
max-line-length = 100
# Ignore non PEP 8 compliant rules as suggested by black
# E203: https://github.com/psf/black/blob/3fab5ade71bccf80ae0a5af76729099869adea56/docs/the_black_code_style/current_style.md#slices
# B042: Weird rule that requires random arguments to be passed, without clear benefit
extend-ignore = [ "E203", "B042" ]
per-file-ignores = [
"tests/unit/example_crlf_file.py:F401",
"tests/unit/profiles/test_black.py:E501",
"tests/unit/test_regressions.py:E501",
]
[tool.mypy]
python_version = "3.11"
strict = true
follow_imports = "silent"
packages = ["isort", "tests"]
exclude = "tests/unit/example_projects|tests/unit/example_crlf_file.py"
[tool.ruff]
target-version = "py311"
line-length = 100
lint.select = [
"ASYNC",
"B",
"C4",
"C90",
"E",
"F",
"FLY",
"PERF",
"PIE",
"PLC",
"PLE",
"PT",
"RUF",
"S",
"UP",
"W",
]
lint.ignore = [
"B904",
"E501",
"PERF203",
"PT030", # Too much work to turn on for now
"RUF100",
]
lint.mccabe.max-complexity = 91 # Default is 10
format.exclude = [ "README.md", "docs/configuration/multi_line_output_modes.md"]
[tool.ruff.lint.per-file-ignores]
"isort/hooks.py" = [ "S603" ]
"isort/output.py" = [ "PLC0206" ]
"isort/settings.py" = [ "PLC0414", "S603", "S607" ]
"tests/*" = [ "RUF001", "S" ]
"tests/unit/example_crlf_file.py" = [ "F401" ]
[tool.isort]
profile = "hug"
src_paths = ["isort", "tests"]
skip = [
"tests/unit/example_crlf_file.py"
]
[tool.pytest.ini_options]
filterwarnings = [
"error",
# isort raies many UserWarnings itself, ignore these globally as it is too much work to disable
# these per warning for now.
"ignore::UserWarning",
# We don't really care about randomizing paths and don't want to add another hypothesis dependency
"ignore:.*from_type\\(thing=Path\\).*:hypothesis.errors.SmallSearchSpaceWarning",
]