diff --git a/pyproject.toml b/pyproject.toml index 845e4b7..2e881f4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,17 +41,37 @@ dynamic = [ dependencies = [ "sphinx>=9.0.4", ] -optional-dependencies.testing = [ - "covdefaults>=2.3", - "defusedxml>=0.7.1", # needed for sphinx.testing - "pytest>=9.0.2", - "pytest-cov>=7", -] urls.Documentation = "https://github.com/tox-dev/sphinx-argparse-cli#sphinx-argparse-cli" urls.Homepage = "https://github.com/tox-dev/sphinx-argparse-cli" urls.Source = "https://github.com/tox-dev/sphinx-argparse-cli" urls.Tracker = "https://github.com/tox-dev/sphinx-argparse-cli/issues" +[dependency-groups] +dev = [ + { include-group = "lint" }, + { include-group = "pkg-meta" }, + { include-group = "test" }, + { include-group = "type" }, +] +test = [ + "covdefaults>=2.3", + "defusedxml>=0.7.1", + "pytest>=9.0.2", + "pytest-cov>=7", +] +type = [ + "ty>=0.0.17", + { include-group = "test" }, +] +lint = [ + "pre-commit-uv>=4.2", +] +pkg-meta = [ + "check-wheel-contents>=0.6.3", + "twine>=6.2", + "uv>=0.9.16", +] + [tool.hatch] build.hooks.vcs.version-file = "src/sphinx_argparse_cli/version.py" build.targets.sdist.include = [ diff --git a/tox.toml b/tox.toml index 6224c50..05c1f70 100644 --- a/tox.toml +++ b/tox.toml @@ -6,7 +6,7 @@ skip_missing_interpreters = true description = "run the unit tests with pytest under {env_name}" package = "wheel" wheel_build_env = ".pkg" -extras = [ "testing" ] +dependency_groups = [ "test" ] pass_env = [ "PYTEST_*" ] set_env.COVERAGE_FILE = { replace = "env", name = "COVERAGE_FILE", default = "{work_dir}{/}.coverage.{env_name}" } commands = [ @@ -38,13 +38,13 @@ commands = [ [env.fix] description = "format the code base to adhere to our styles, and complain about what we cannot do automatically" skip_install = true -deps = [ "pre-commit-uv>=4.2" ] +dependency_groups = [ "lint" ] commands = [ [ "pre-commit", "run", "--all-files", "--show-diff-on-failure" ] ] [env.pkg_meta] description = "check that the long description is valid" skip_install = true -deps = [ "check-wheel-contents>=0.6.3", "twine>=6.2", "uv>=0.9.16" ] +dependency_groups = [ "pkg-meta" ] commands = [ [ "uv", "build", "--sdist", "--wheel", "--out-dir", "{env_tmp_dir}", "." ], [ "twine", "check", "{env_tmp_dir}{/}*" ], @@ -53,12 +53,13 @@ commands = [ [env.type] description = "run type check on code base" -deps = [ "ty>=0.0.17" ] +dependency_groups = [ "type" ] commands = [ [ "ty", "check", "--output-format", "concise", "--error-on-warning", "." ] ] [env.dev] description = "generate a DEV environment" package = "editable" +dependency_groups = [ "dev" ] commands = [ [ "uv", "pip", "tree" ], [ "python", "-c", "import sys; print(sys.executable)" ],