From 8f53bafb3a8b0477863fc38b91ea41522978f897 Mon Sep 17 00:00:00 2001 From: mmwinther Date: Thu, 25 Jan 2024 10:55:23 +0100 Subject: [PATCH 1/2] Add tooling install instructions to contributor guide --- {{cookiecutter.project_name}}/CONTRIBUTING.md | 43 +++++++++++++++---- 1 file changed, 34 insertions(+), 9 deletions(-) diff --git a/{{cookiecutter.project_name}}/CONTRIBUTING.md b/{{cookiecutter.project_name}}/CONTRIBUTING.md index c33218cf6..15eba9176 100644 --- a/{{cookiecutter.project_name}}/CONTRIBUTING.md +++ b/{{cookiecutter.project_name}}/CONTRIBUTING.md @@ -43,18 +43,43 @@ You need Python 3.9+ and the following tools: - [Nox] - [nox-poetry] +Install [pipx]: + +```console +python -m pip install --user pipx +python -m pipx ensurepath +``` + +Install [Poetry]: + +```console +pipx install poetry +``` + +Install [Nox] and [nox-poetry]: + +```console +pipx install nox +pipx inject nox nox-poetry +``` + +Install the pre-commit hooks + +```console +nox --session=pre-commit -- install +``` + Install the package with development requirements: ```console -$ poetry install +poetry install ``` -You can now run an interactive Python session, -or the command-line interface: +You can now run an interactive Python session, or your app: ```console -$ poetry run python -$ poetry run {{cookiecutter.project_name}} +poetry run python +poetry run {{cookiecutter.project_name}} ``` [poetry]: https://python-poetry.org/ @@ -66,20 +91,20 @@ $ poetry run {{cookiecutter.project_name}} Run the full test suite: ```console -$ nox +nox ``` List the available Nox sessions: ```console -$ nox --list-sessions +nox --list-sessions ``` You can also run a specific Nox session. For example, invoke the unit test suite like this: ```console -$ nox --session=tests +nox --session=tests ``` Unit tests are located in the _tests_ directory, @@ -102,7 +127,7 @@ Feel free to submit early, though—we can always iterate on this. To run linting and code formatting checks before committing your change, you can install pre-commit as a Git hook by running the following command: ```console -$ nox --session=pre-commit -- install +nox --session=pre-commit -- install ``` It is recommended to open an issue before starting work on anything. From 21fe3b74930778630553e66f0aaeb56fce666087 Mon Sep 17 00:00:00 2001 From: mmwinther Date: Thu, 25 Jan 2024 11:00:33 +0100 Subject: [PATCH 2/2] Collect links at the bottom of the doc --- {{cookiecutter.project_name}}/CONTRIBUTING.md | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/{{cookiecutter.project_name}}/CONTRIBUTING.md b/{{cookiecutter.project_name}}/CONTRIBUTING.md index 15eba9176..72e0ea4b8 100644 --- a/{{cookiecutter.project_name}}/CONTRIBUTING.md +++ b/{{cookiecutter.project_name}}/CONTRIBUTING.md @@ -11,11 +11,6 @@ Here is a list of important resources for contributors: - [Issue Tracker] - [Code of Conduct] -[{{cookiecutter.license.replace("-", " ").lower()}} license]: https://opensource.org/licenses/{{cookiecutter.license}} -[source code]: https://github.com/{{cookiecutter.github_organization}}/{{cookiecutter.project_name}} -[documentation]: https://{{cookiecutter.github_organization}}.github.io/{{cookiecutter.project_name}} -[issue tracker]: https://github.com/{{cookiecutter.github_organization}}/{{cookiecutter.project_name}}/issues - ## How to report a bug Report bugs on the [Issue Tracker]. @@ -82,10 +77,6 @@ poetry run python poetry run {{cookiecutter.project_name}} ``` -[poetry]: https://python-poetry.org/ -[nox]: https://nox.thea.codes/ -[nox-poetry]: https://nox-poetry.readthedocs.io/ - ## How to test the project Run the full test suite: @@ -110,8 +101,6 @@ nox --session=tests Unit tests are located in the _tests_ directory, and are written using the [pytest] testing framework. -[pytest]: https://pytest.readthedocs.io/ - ## How to submit changes Open a [pull request] to submit changes to this project. @@ -133,6 +122,15 @@ nox --session=pre-commit -- install It is recommended to open an issue before starting work on anything. This will allow a chance to talk it over with the owners and validate your approach. +[{{cookiecutter.license.replace("-", " ").lower()}} license]: https://opensource.org/licenses/{{cookiecutter.license}} +[source code]: https://github.com/{{cookiecutter.github_organization}}/{{cookiecutter.project_name}} +[documentation]: https://{{cookiecutter.github_organization}}.github.io/{{cookiecutter.project_name}} +[issue tracker]: https://github.com/{{cookiecutter.github_organization}}/{{cookiecutter.project_name}}/issues +[pipx]: https://pipx.pypa.io/ +[poetry]: https://python-poetry.org/ +[nox]: https://nox.thea.codes/ +[nox-poetry]: https://nox-poetry.readthedocs.io/ +[pytest]: https://pytest.readthedocs.io/ [pull request]: https://github.com/{{cookiecutter.github_organization}}/{{cookiecutter.project_name}}/pulls