Skip to content

Commit 745167e

Browse files
authored
fix: tweak the hatch integration (#310)
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
1 parent 4a85cbe commit 745167e

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

noxfile.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,11 +243,10 @@ def native(session: nox.Session, backend: str, vcs: bool) -> None:
243243
session.chdir(cookie)
244244

245245
if backend == "hatch":
246-
session.run(backend, "env", "create")
246+
session.run(backend, "run", "test")
247247
else:
248248
session.run(backend, "install")
249-
250-
session.run(backend, "run", "pytest")
249+
session.run(backend, "run", "pytest")
251250

252251

253252
@nox.session()

{{cookiecutter.project_name}}/pyproject.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,11 @@ version.path = "src/{{ cookiecutter.__project_slug }}/__init__.py"
253253
version.source = "vcs"
254254
build.hooks.vcs.version-file = "src/{{ cookiecutter.__project_slug }}/_version.py"
255255
{%- endif %}
256-
envs.default.dependencies = [
257-
"pytest",
258-
"pytest-cov",
259-
]
256+
257+
[tool.hatch.env.default]
258+
features = ["test"]
259+
scripts.test = "pytest {args}"
260+
260261

261262
{%- elif cookiecutter.backend == "pdm" %}
262263
{%- if cookiecutter.vcs %}

0 commit comments

Comments
 (0)