blob: f6ba3c3195fa965b18e0502128b49e0efbf48070 [file] [log] [blame] [edit]
[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",
]