[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.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.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.10.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 = [ "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", ] [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" ] 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" packages = ["isort", "tests"] exclude = "isort/_vendored|tests/unit/example_projects|tests/unit/example_crlf_file.py" [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 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", ]