From 1dc6d76f5fb29d360876017a022186d31358b851 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Wed, 3 Dec 2025 17:13:31 -0500 Subject: [PATCH] fix: use modern hatch test and dependency-groups Signed-off-by: Henry Schreiner --- noxfile.py | 2 +- {{cookiecutter.project_name}}/pyproject.toml | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/noxfile.py b/noxfile.py index 707c89ae..47b68267 100755 --- a/noxfile.py +++ b/noxfile.py @@ -272,7 +272,7 @@ def native(session: nox.Session, backend: str, vcs: bool, docs: Docs) -> None: session.chdir(cookie) if backend == "hatch": - session.run(backend, "run", "test") + session.run(backend, "test") elif backend == "poetry": session.run(backend, "sync", env={"VIRTUAL_ENV": None}) session.run(backend, "run", "pytest", env={"VIRTUAL_ENV": None}) diff --git a/{{cookiecutter.project_name}}/pyproject.toml b/{{cookiecutter.project_name}}/pyproject.toml index acd693b3..d30ac7af 100644 --- a/{{cookiecutter.project_name}}/pyproject.toml +++ b/{{cookiecutter.project_name}}/pyproject.toml @@ -178,10 +178,11 @@ build.hooks.vcs.version-file = "src/{{ cookiecutter.__project_slug }}/_version.p {%- endif %} [tool.hatch.envs.default] -# duplicate for now since hatch doesn't support groups yet -dependencies = [] -scripts.test = "pytest {args}" +dependency-groups = ["dev"] +[tool.hatch.envs.hatch-test] +dependency-groups = ["test"] +env-vars.PYTHONWARNDEFAULTENCODING = "1" {%- elif cookiecutter.backend == "pdm" %} {%- if cookiecutter.vcs %}