From 175dc4d20d63703edb8cc5a042b4b10692619d29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bern=C3=A1t=20G=C3=A1bor?= Date: Wed, 30 Oct 2024 08:35:28 -0700 Subject: [PATCH 1/2] Use dependency groups MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Bernát Gábor --- .pre-commit-config.yaml | 2 +- pyproject.toml | 29 ++++++++++++++++++++--------- tox.ini | 12 ++++-------- 3 files changed, 25 insertions(+), 18 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index be80f9c..20bd8b9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,7 +20,7 @@ repos: - id: tox-ini-fmt args: ["-p", "fix"] - repo: https://github.com/tox-dev/pyproject-fmt - rev: "v2.4.3" + rev: "v2.5.0" hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit diff --git a/pyproject.toml b/pyproject.toml index 36aaef5..d8ece16 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,11 +41,25 @@ dynamic = [ ] dependencies = [ "packaging>=24.1", - "tox<5,>=4.21.2", + "tox>=4.21.2,<5", "typing-extensions>=4.12.2; python_version<'3.10'", - "uv<1,>=0.4.18", + "uv>=0.4.18,<1", ] -optional-dependencies.testing = [ +urls.Changelog = "https://github.com/tox-dev/tox-uv/releases" +urls.Documentation = "https://github.com/tox-dev/tox-uv#tox-uv" +urls.Homepage = "https://github.com/tox-dev/tox-uv" +urls.Source = "https://github.com/tox-dev/tox-uv" +urls.Tracker = "https://github.com/tox-dev/tox-uv/issues" +entry-points.tox.tox-uv = "tox_uv.plugin" + +[dependency-groups] +dev = [ + { include-group = "lint" }, + { include-group = "pkg-meta" }, + { include-group = "test" }, + { include-group = "type" }, +] +test = [ "covdefaults>=2.3", "devpi-process>=1.0.2", "diff-cover>=9.2", @@ -53,12 +67,9 @@ optional-dependencies.testing = [ "pytest-cov>=5", "pytest-mock>=3.14", ] -urls.Changelog = "https://github.com/tox-dev/tox-uv/releases" -urls.Documentation = "https://github.com/tox-dev/tox-uv#tox-uv" -urls.Homepage = "https://github.com/tox-dev/tox-uv" -urls.Source = "https://github.com/tox-dev/tox-uv" -urls.Tracker = "https://github.com/tox-dev/tox-uv/issues" -entry-points.tox.tox-uv = "tox_uv.plugin" +type = [ "mypy==1.11.2", { include-group = "test" }] +lint = [ "pre-commit-uv>=4.1.3" ] +pkg-meta = [ "check-wheel-contents>=0.6", "twine>=5.1.1", "uv>=0.4.18" ] [tool.hatch] build.hooks.vcs.version-file = "src/tox_uv/version.py" diff --git a/tox.ini b/tox.ini index e9b1344..8d298c0 100644 --- a/tox.ini +++ b/tox.ini @@ -17,8 +17,7 @@ skip_missing_interpreters = true description = run the unit tests with pytest under {base_python} package = wheel wheel_build_env = .pkg -extras = - testing +dependency_groups = test pass_env = DIFF_AGAINST PYTEST_* @@ -43,8 +42,7 @@ commands = [testenv:type] description = run type check on code base -deps = - mypy==1.11.2 +dependency_groups = type commands = mypy src mypy tests @@ -52,10 +50,7 @@ commands = [testenv:pkg_meta] description = check that the long description is valid skip_install = true -deps = - check-wheel-contents>=0.6 - twine>=5.1.1 - uv>=0.4.18 +dependency_groups = pkg-meta commands = uv build --sdist --wheel --out-dir {env_tmp_dir} . twine check {env_tmp_dir}{/}* @@ -64,6 +59,7 @@ commands = [testenv:dev] description = generate a DEV environment package = editable +dependency_groups = dev commands = uv pip tree python -c 'import sys; print(sys.executable)' From 6740e7efb55865573fb3971ed4230a45b780d578 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 30 Oct 2024 15:39:09 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- pyproject.toml | 2 +- tox.ini | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index d8ece16..e76d832 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -67,7 +67,7 @@ test = [ "pytest-cov>=5", "pytest-mock>=3.14", ] -type = [ "mypy==1.11.2", { include-group = "test" }] +type = [ "mypy==1.11.2", { include-group = "test" } ] lint = [ "pre-commit-uv>=4.1.3" ] pkg-meta = [ "check-wheel-contents>=0.6", "twine>=5.1.1", "uv>=0.4.18" ] diff --git a/tox.ini b/tox.ini index 8d298c0..42884ba 100644 --- a/tox.ini +++ b/tox.ini @@ -17,7 +17,6 @@ skip_missing_interpreters = true description = run the unit tests with pytest under {base_python} package = wheel wheel_build_env = .pkg -dependency_groups = test pass_env = DIFF_AGAINST PYTEST_* @@ -31,6 +30,7 @@ commands = --junitxml {work_dir}{/}junit.{env_name}.xml \ tests} diff-cover --compare-branch {env:DIFF_AGAINST:origin/main} {work_dir}{/}coverage.{env_name}.xml --fail-under 100 +dependency_groups = test [testenv:fix] description = format the code base to adhere to our styles, and complain about what we cannot do automatically @@ -42,24 +42,24 @@ commands = [testenv:type] description = run type check on code base -dependency_groups = type commands = mypy src mypy tests +dependency_groups = type [testenv:pkg_meta] description = check that the long description is valid skip_install = true -dependency_groups = pkg-meta commands = uv build --sdist --wheel --out-dir {env_tmp_dir} . twine check {env_tmp_dir}{/}* check-wheel-contents --no-config {env_tmp_dir} +dependency_groups = pkg-meta [testenv:dev] description = generate a DEV environment package = editable -dependency_groups = dev commands = uv pip tree python -c 'import sys; print(sys.executable)' +dependency_groups = dev