From 261a823527519afefb751a84cda93c510ed87c29 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Mon, 21 Oct 2024 22:26:30 +0300 Subject: [PATCH 1/5] Update pre-commit --- .pre-commit-config.yaml | 8 ++++---- pyproject.toml | 3 --- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 58cdaeb..598849f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.6.9 + rev: v0.7.0 hooks: - id: ruff args: [--exit-non-zero-on-fix] @@ -27,7 +27,7 @@ repos: exclude: tests/data/expected_output.py - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.29.3 + rev: 0.29.4 hooks: - id: check-github-workflows - id: check-renovate @@ -56,12 +56,12 @@ repos: # ] - repo: https://github.com/tox-dev/pyproject-fmt - rev: 2.2.4 + rev: 2.4.3 hooks: - id: pyproject-fmt - repo: https://github.com/abravalheri/validate-pyproject - rev: v0.20.2 + rev: v0.21 hooks: - id: validate-pyproject diff --git a/pyproject.toml b/pyproject.toml index 9d6cb88..6bff934 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -96,9 +96,6 @@ lint.flake8-import-conventions.banned-from = [ "datetime" ] lint.isort.known-first-party = [ "norwegianblue" ] lint.isort.required-imports = [ "from __future__ import annotations" ] -[tool.pyproject-fmt] -max_supported_python = "3.13" - [tool.pytest.ini_options] addopts = "--color=yes" filterwarnings = [ From 7a802164c6ecdc49b5c06b3dd8935a2c6c43c702 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Mon, 21 Oct 2024 22:30:27 +0300 Subject: [PATCH 2/5] Replace 'tests' extra with 'test' dependency group (PEP 753) --- pyproject.toml | 14 ++++++++------ tox.ini | 4 ++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6bff934..56079fa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,12 +43,6 @@ dependencies = [ "python-slugify", "termcolor>=2.1", ] -optional-dependencies.tests = [ - "freezegun", - "pytest", - "pytest-cov", - "respx>=0.11", -] urls.Changelog = "https://github.com/hugovk/norwegianblue/releases" urls.Homepage = "https://github.com/hugovk/norwegianblue" urls.Source = "https://github.com/hugovk/norwegianblue" @@ -103,3 +97,11 @@ filterwarnings = [ "ignore:sys.monitoring isn't available, using default core:coverage.exceptions.CoverageWarning", ] testpaths = [ "tests" ] + +[dependency_groups] +test = [ + "freezegun", + "pytest", + "pytest-cov", + "respx>=0.11", +] diff --git a/tox.ini b/tox.ini index cb0dfdf..bd31a3c 100644 --- a/tox.ini +++ b/tox.ini @@ -9,8 +9,6 @@ env_list = py{py3, 313, 312, 311, 310, 39} [testenv] -extras = - tests set_env = COVERAGE_CORE = sysmon commands = @@ -21,6 +19,8 @@ commands = --cov-report term \ --cov-report xml \ {posargs} +dependency_groups = + test [testenv:cog] skip_install = true From b0f700ec6feb8773ad672d909e601611bff54339 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Mon, 21 Oct 2024 22:30:59 +0300 Subject: [PATCH 3/5] Fix pyproject.toml name --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 56079fa..e691bb3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -98,7 +98,7 @@ filterwarnings = [ ] testpaths = [ "tests" ] -[dependency_groups] +[dependency-groups] test = [ "freezegun", "pytest", From b24554cef4b1123de5970b991ef46a9e3db993f1 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Mon, 21 Oct 2024 22:49:08 +0300 Subject: [PATCH 4/5] Tell tox to use the dependency group in pyproject.toml instead of tox.ini --- pyproject.toml | 5 +++++ tox.ini | 2 -- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index e691bb3..5c92a2e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -98,6 +98,11 @@ filterwarnings = [ ] testpaths = [ "tests" ] +[tool.tox.env_run_base] +dependency-groups = [ + "test", +] + [dependency-groups] test = [ "freezegun", diff --git a/tox.ini b/tox.ini index bd31a3c..81ec8d8 100644 --- a/tox.ini +++ b/tox.ini @@ -19,8 +19,6 @@ commands = --cov-report term \ --cov-report xml \ {posargs} -dependency_groups = - test [testenv:cog] skip_install = true From c1bcf07b55d604ea219255571d594127dcddce9a Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Tue, 22 Oct 2024 13:13:59 +0300 Subject: [PATCH 5/5] Use dependency_groups in tool.tox.env_run_base --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 5c92a2e..6e7db70 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -99,7 +99,7 @@ filterwarnings = [ testpaths = [ "tests" ] [tool.tox.env_run_base] -dependency-groups = [ +dependency_groups = [ "test", ]