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
|
[project]
name = "isort"
dynamic = ["version"]
description = "A Python utility / library to sort Python imports."
authors = [{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://pycqa.github.io/isort/"
documentation = "https://pycqa.github.io/isort/"
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.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"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.10.0"
dependencies = []
[project.urls]
Homepage = "https://pycqa.github.io/isort/index.html"
Documentation = "https://pycqa.github.io/isort/index.html"
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 = [
"isort/_vendored/*",
"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",
]
[tool.portray.mkdocs]
edit_uri = "https://github.com/pycqa/isort/edit/main/"
extra_css = ["art/stylesheets/extra.css"]
[tool.portray.mkdocs.theme]
name = "material"
favicon = "art/logo.png"
logo = "art/logo.png"
palette = {scheme = "isort"}
[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"
[dependency-groups]
dev = [
"bandit>=1.8.6",
"black>=25.9.0",
"colorama>=0.4.6",
"coverage[toml]>=7.10.7",
"cruft>=2.16.0",
"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",
"httpx>=0.13.3",
"hypothesis>=6.140.3",
"hypothesmith>=0.3.3",
"libcst>=1.8.5",
"mypy>=1.18.2",
"pep8-naming>=0.15.1",
"pip>=21.1.1",
"portray>=1.8.0",
"pytest>=8.4.2",
"pytest-benchmark>=5.1.0",
"ruff>=0.13.3",
"stdlibs>=2024.10.21.16",
"toml>=0.10.2",
"tox>=4.30.3",
"tox-uv>=1.28.0",
"types-colorama>=0.4.2",
"types-toml>=0.1.3",
"uv>=0.8.23",
]
[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
extend-ignore = [ "E203" ]
exclude = "_vendored"
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.10"
strict = true
follow_imports = "silent"
exclude = "isort/_vendored|tests/unit/example_projects|tests/unit/example_crlf_file.py"
[[tool.mypy.overrides]]
module = "tests.*"
allow_untyped_defs = true
allow_incomplete_defs = true
allow_untyped_calls = true
[[tool.mypy.overrides]]
module = "importlib_metadata.*"
ignore_missing_imports = true
[tool.ruff]
target-version = "py310"
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.exclude = [ "isort/_vendored/*" ]
lint.mccabe.max-complexity = 91 # Default is 10
[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",
]
|