[build-system]
build-backend = "hatchling.build"
requires = [
  "hatchling",
]

[project]
name = "nox"
version = "2026.07.11"
description = "Flexible test automation."
readme = "README.md"
keywords = [
  "automation",
  "testing",
  "tox",
]
license = "Apache-2.0"
authors = [
  { name = "Alethea Katherine Flowers", email = "me@thea.codes" },
]
requires-python = ">=3.10"
classifiers = [
  "Development Status :: 5 - Production/Stable",
  "Environment :: Console",
  "Intended Audience :: Developers",
  "Operating System :: MacOS",
  "Operating System :: Microsoft :: Windows",
  "Operating System :: POSIX",
  "Operating System :: Unix",
  "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 :: 3.15",
  "Topic :: Software Development :: Testing",
]
dependencies = [
  "argcomplete>=1.9.4,<4",
  "attrs>=24.1",
  "colorlog>=2.6.1,<7",
  "dependency-groups>=1.1",
  "humanize>=4",
  "packaging>=22",
  "tomli>=1.1; python_version<'3.11'",
  "virtualenv>=20.15",
]
optional-dependencies.pbs = [
  "pbs-installer[all]>=2025.1.6",
]
optional-dependencies.tox-to-nox = [
  "jinja2",
  "tox>=4",
]
optional-dependencies.uv = [
  "uv>=0.1.6",
]
urls.bug-tracker = "https://github.com/wntrblm/nox/issues"
urls.documentation = "https://nox.thea.codes"
urls.homepage = "https://github.com/wntrblm/nox"
urls.repository = "https://github.com/wntrblm/nox"
scripts.nox = "nox.__main__:main"
scripts.tox-to-nox = "nox.tox_to_nox:main"

[dependency-groups]
dev = [
  { include-group = "test" },
]
test = [
  "coverage[toml]>=7.10.3",
  "pytest>=7.4; python_version>='3.12'",
  "pytest>=7; python_version<'3.12'",
  "pytest-xdist>=3",
]
docs = [
  "docutils<0.22",    # Waiting for sphinx-tabs release
  "myst-parser",
  "sphinx>=3",
  "sphinx-autobuild",
  "sphinx-tabs",
  "witchhazel",
]

[tool.ruff]
show-fixes = true
lint.select = [ "ALL" ]
lint.ignore = [
  "A002",    # Function arguments can shadow builtins
  "ANN401",  # Any allowed (TODO: some maybe can be removed)
  "C9",      # Complexity
  "COM812",  # Trailing commas inform the formatter
  "D",       # Too many docs
  "E501",    # Line too long
  "FIX",     # We have todos
  "N802",    # Function name should be lowercase
  "N818",    # Error suffix for errors
  "PLR09",   # Too many X
  "PLR2004", # Magic value used in comparison
  "PTH",     # Path usage (TODO)
  "RSE102",  # Parens on exception
  "S101",    # Assert is used by mypy and pytest
  "S603",    # subprocess call - check for execution of untrusted input
  "SLF001",  # Private member access
  "T20",     # We use print
  "TD",      # TODO format
]
lint.per-file-ignores.".github/**.py" = [ "INP001" ]
lint.per-file-ignores."docs/**.py" = [ "ERA001", "INP001" ]
lint.per-file-ignores."tests/*.py" = [ "FBT001", "INP001" ]
lint.per-file-ignores."tests/resources/**.py" = [ "ANN", "ARG001", "DTZ001", "ERA001", "TRY002" ]
lint.typing-modules = [ "nox._typing" ]
lint.flake8-annotations.allow-star-arg-any = true
lint.flake8-builtins.ignorelist = [ "copyright" ]
lint.flake8-unused-arguments.ignore-variadic-names = true

[tool.pyproject-fmt]
max_supported_python = "3.15"

[tool.mypy]
mypy_path = [ ".github" ]
python_version = "3.10"
warn_unreachable = true
enable_error_code = [ "ignore-without-code", "redundant-expr", "truthy-bool" ]
strict = true
overrides = [ { module = [ "tox.*" ], ignore_missing_imports = true } ]

[tool.pytest]
ini_options.minversion = "7.0"
ini_options.testpaths = [ "tests" ]
ini_options.pythonpath = [ ".github/" ]
ini_options.addopts = [ "-ra", "--strict-markers", "--strict-config" ]
ini_options.markers = [
  "conda: test requires conda",
]
ini_options.xfail_strict = true
ini_options.filterwarnings = [ "error" ]
ini_options.log_level = "INFO"

[tool.coverage]
run.branch = true
run.core = "sysmon"
run.disable_warnings = [
  "no-sysmon",
]
run.patch = [ "subprocess" ]
run.relative_files = true
run.source_pkgs = [ "nox" ]
report.exclude_also = [
  "@overload",
  "def __dir__()",
  "def __repr__",
  "if TYPE_CHECKING:",
]
report.omit = [ "nox/_typing.py" ]
