From 0d532f762b29a6364b026936b9c93014137ac16f Mon Sep 17 00:00:00 2001 From: Phil Schaf Date: Thu, 5 Sep 2024 15:15:53 +0200 Subject: [PATCH 1/2] Update post output for hatch --- hooks/post_gen_project.py | 8 +++++--- scripts/src/scverse_template_scripts/make_rich_output.py | 9 ++++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index 4cfcd207..c2c214d6 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -42,11 +42,13 @@ ┃ \x1b[1mInstall the package\x1b[0m ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ -To run tests or build the documentation locally, you need to install -your package and its dependencies. You can do so with +To run tests or build the documentation locally, get familiar with \x1b]8;id=707150;https://hatch.pypa.io/latest/tutorials/environment/basic-usage/\x1b\\\x1b[4;34mhatch\x1b[0m\x1b]8;;\x1b\\ +\x1b]8;id=707150;https://hatch.pypa.io/latest/tutorials/environment/basic-usage/\x1b\\\x1b[4;34menvironments\x1b[0m\x1b]8;;\x1b\\, and see \x1b[1;36;40m[tool.hatch.envs.*]\x1b[0m in \x1b[1;36;40mpyproject.toml\x1b[0m: \x1b[40m \x1b[0m -\x1b[40m \x1b[0m\x1b[97;40mpip\x1b[0m\x1b[97;40m \x1b[0m\x1b[97;40minstall\x1b[0m\x1b[97;40m \x1b[0m\x1b[93;40m".[test,dev,doc]"\x1b[0m\x1b[40m \x1b[0m\x1b[40m \x1b[0m +\x1b[40m \x1b[0m\x1b[97;40mhatch\x1b[0m\x1b[97;40m \x1b[0m\x1b[97;40mrun\x1b[0m\x1b[97;40m \x1b[0m\x1b[97;40mpre-commit\x1b[0m\x1b[97;40m \x1b[0m\x1b[97;40mrun\x1b[0m\x1b[97;40m \x1b[0m\x1b[97;40m--all-files\x1b[0m\x1b[97;40m \x1b[0m\x1b[37;40m# tool.hatch.envs.default\x1b[0m\x1b[40m \x1b[0m\x1b[40m \x1b[0m +\x1b[40m \x1b[0m\x1b[97;40mhatch\x1b[0m\x1b[97;40m \x1b[0m\x1b[97;40mtest\x1b[0m\x1b[97;40m \x1b[0m\x1b[37;40m# tool.hatch.envs.hatch-test\x1b[0m\x1b[40m \x1b[0m\x1b[40m \x1b[0m +\x1b[40m \x1b[0m\x1b[97;40mhatch\x1b[0m\x1b[97;40m \x1b[0m\x1b[97;40mrun\x1b[0m\x1b[97;40m \x1b[0m\x1b[97;40mdocs:build\x1b[0m\x1b[97;40m \x1b[0m\x1b[37;40m# tool.hatch.envs.docs\x1b[0m\x1b[40m \x1b[0m\x1b[40m \x1b[0m \x1b[40m \x1b[0m ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ diff --git a/scripts/src/scverse_template_scripts/make_rich_output.py b/scripts/src/scverse_template_scripts/make_rich_output.py index a7418717..e7f089f3 100644 --- a/scripts/src/scverse_template_scripts/make_rich_output.py +++ b/scripts/src/scverse_template_scripts/make_rich_output.py @@ -24,11 +24,13 @@ # Install the package -To run tests or build the documentation locally, you need to install your package and its dependencies. -You can do so with +To run tests or build the documentation locally, get familiar with [hatch environments][hatch-envs], +and see `[tool.hatch.envs.*]` in `pyproject.toml`: ```bash -pip install ".[test,dev,doc]" +hatch run pre-commit run --all-files # tool.hatch.envs.default +hatch test # tool.hatch.envs.hatch-test +hatch run docs:build # tool.hatch.envs.docs ``` # Customizations @@ -47,6 +49,7 @@ [setup-pre-commit]: {dev_docs_url}#pre-commit-checks [setup-rtd]: {dev_docs_url}#documentation-on-readthedocs [setup-codecov]: {dev_docs_url}#coverage-tests-with-codecov +[hatch-envs]: https://hatch.pypa.io/latest/tutorials/environment/basic-usage/ [write-tests]: {dev_docs_url}#writing-tests [write-docs]: {dev_docs_url}#writing-documentation [scverse discourse]: https://discourse.scverse.org/ From 9709cf429d3b5088c8f32fede341b082b3109048 Mon Sep 17 00:00:00 2001 From: "Philipp A." Date: Fri, 6 Sep 2024 14:56:01 +0200 Subject: [PATCH 2/2] update title --- hooks/post_gen_project.py | 2 +- scripts/src/scverse_template_scripts/make_rich_output.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index c2c214d6..c3191de3 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -39,7 +39,7 @@ tool! ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ -┃ \x1b[1mInstall the package\x1b[0m ┃ +┃ \x1b[1mLocal development\x1b[0m ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ To run tests or build the documentation locally, get familiar with \x1b]8;id=707150;https://hatch.pypa.io/latest/tutorials/environment/basic-usage/\x1b\\\x1b[4;34mhatch\x1b[0m\x1b]8;;\x1b\\ diff --git a/scripts/src/scverse_template_scripts/make_rich_output.py b/scripts/src/scverse_template_scripts/make_rich_output.py index e7f089f3..f72059a7 100644 --- a/scripts/src/scverse_template_scripts/make_rich_output.py +++ b/scripts/src/scverse_template_scripts/make_rich_output.py @@ -22,7 +22,7 @@ All CI checks should pass, you are ready to start developing your new tool! -# Install the package +# Local development To run tests or build the documentation locally, get familiar with [hatch environments][hatch-envs], and see `[tool.hatch.envs.*]` in `pyproject.toml`: