From 23007b7786d9981fc31d2e03f4fe68766f18f26f Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Tue, 14 Nov 2023 17:36:03 -0500 Subject: [PATCH] fix: tweak the hatch integration Signed-off-by: Henry Schreiner --- noxfile.py | 5 ++--- {{cookiecutter.project_name}}/pyproject.toml | 9 +++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/noxfile.py b/noxfile.py index 1438730f..f8f3b7e5 100644 --- a/noxfile.py +++ b/noxfile.py @@ -243,11 +243,10 @@ def native(session: nox.Session, backend: str, vcs: bool) -> None: session.chdir(cookie) if backend == "hatch": - session.run(backend, "env", "create") + session.run(backend, "run", "test") else: session.run(backend, "install") - - session.run(backend, "run", "pytest") + session.run(backend, "run", "pytest") @nox.session() diff --git a/{{cookiecutter.project_name}}/pyproject.toml b/{{cookiecutter.project_name}}/pyproject.toml index 34927eb6..7043a44e 100644 --- a/{{cookiecutter.project_name}}/pyproject.toml +++ b/{{cookiecutter.project_name}}/pyproject.toml @@ -253,10 +253,11 @@ version.path = "src/{{ cookiecutter.__project_slug }}/__init__.py" version.source = "vcs" build.hooks.vcs.version-file = "src/{{ cookiecutter.__project_slug }}/_version.py" {%- endif %} -envs.default.dependencies = [ - "pytest", - "pytest-cov", -] + +[tool.hatch.env.default] +features = ["test"] +scripts.test = "pytest {args}" + {%- elif cookiecutter.backend == "pdm" %} {%- if cookiecutter.vcs %}