From 2e3ab38ed2e4e6afeb5dba978ffa3a2fd875ee25 Mon Sep 17 00:00:00 2001 From: "Philipp A." Date: Mon, 2 Sep 2024 14:15:57 +0200 Subject: [PATCH] Add hatch-test env customization (#1627) --- hatch.toml | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/hatch.toml b/hatch.toml index 51eb854c7..ecbe889d4 100644 --- a/hatch.toml +++ b/hatch.toml @@ -4,12 +4,26 @@ features = ["dev"] [envs.docs] features = ["doc"] -dependencies = ["setuptools"] # https://bitbucket.org/pybtex-devs/pybtex/issues/169 +extra-dependencies = ["setuptools"] # https://bitbucket.org/pybtex-devs/pybtex/issues/169 +scripts.build = "sphinx-build -M html docs docs/_build -W --keep-going {args}" +scripts.clean = "git clean -fdX -- {args:docs}" -[envs.docs.scripts] -build = "sphinx-build -M html docs docs/_build -W --keep-going {args}" -clean = "git clean -fX -- docs" +[envs.towncrier] +scripts.build = "python3 ci/scripts/towncrier_automation.py {args}" +scripts.clean = "git restore --source=HEAD --staged --worktree -- docs/release-notes" -[envs.towncrier.scripts] -build = "python3 ci/scripts/towncrier_automation.py {args}" -clean = "git restore --source=HEAD --staged --worktree -- docs/release-notes" +[envs.hatch-test] +default-args = [] +extra-dependencies = ["ipykernel"] +features = ["dev", "test"] +overrides.matrix.deps.env-vars = [ + { key = "UV_PRERELEASE", value = "allow", if = ["pre"] }, + { key = "UV_RESOLUTION", value = "lowest-direct", if = ["min"] }, +] +overrides.matrix.deps.python = [ + { if = ["min"], value = "3.9" }, + { if = ["stable", "pre"], value = "3.12" }, +] + +[[envs.hatch-test.matrix]] +deps = ["stable", "pre", "min"]