Skip to content

Commit 4555a59

Browse files
authored
fix: use modern hatch test and dependency-groups (#716)
Signed-off-by: Henry Schreiner <[email protected]>
1 parent 19c2d4c commit 4555a59

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

noxfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ def native(session: nox.Session, backend: str, vcs: bool, docs: Docs) -> None:
272272
session.chdir(cookie)
273273

274274
if backend == "hatch":
275-
session.run(backend, "run", "test")
275+
session.run(backend, "test")
276276
elif backend == "poetry":
277277
session.run(backend, "sync", env={"VIRTUAL_ENV": None})
278278
session.run(backend, "run", "pytest", env={"VIRTUAL_ENV": None})

{{cookiecutter.project_name}}/pyproject.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,11 @@ build.hooks.vcs.version-file = "src/{{ cookiecutter.__project_slug }}/_version.p
177177
{%- endif %}
178178

179179
[tool.hatch.envs.default]
180-
# duplicate for now since hatch doesn't support groups yet
181-
dependencies = []
182-
scripts.test = "pytest {args}"
180+
dependency-groups = ["dev"]
183181

182+
[tool.hatch.envs.hatch-test]
183+
dependency-groups = ["test"]
184+
env-vars.PYTHONWARNDEFAULTENCODING = "1"
184185

185186
{%- elif cookiecutter.backend == "pdm" %}
186187
{%- if cookiecutter.vcs %}

0 commit comments

Comments
 (0)