You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: {{cookiecutter.project_name}}/docs/template_usage.md
+25-31Lines changed: 25 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,12 @@
1
1
# Using this template
2
2
3
-
Welcome to the developer guidelines! This document is split into two parts:
3
+
Welcome to the developer guidelines!
4
+
This section is relevant primarily for the repository maintainer
5
+
and shows how to connect continuous integration services and documents initial set-up of the repository.
6
+
For information relevant to all developers who want to make a contribution,
7
+
please refer to the [contributor guide](contributing.md#contributing-guide).
4
8
5
-
1. The [repository setup](#setting-up-the-repository).
6
-
This section is relevant primarily for the repository maintainer and shows how to connect continuous integration services and documents initial set-up of the repository.
7
-
2. The [contributor guide](contributing.md#contributing-guide).
8
-
It contains information relevant to all developers who want to make a contribution.
9
-
10
-
## Setting up the repository
11
-
12
-
### First commit
9
+
## First commit
13
10
14
11
If you are reading this, you should have just completed the repository creation with:
15
12
@@ -47,22 +44,22 @@ While the repository at this point can be directly used, there are few remaining
Modern Python package management uses a `pyproject.toml` that was first introduced in [PEP 518](https://peps.python.org/pep-0518/).
53
50
This file contains build system requirements and information, which are used by pip to build the package, and tool configurations.
54
51
For more details please have a look at [pip's description of the pyproject.toml file](https://pip.pypa.io/en/stable/reference/build-system/pyproject-toml/).
55
52
It also serves as a single point of truth to define test environments and how docs are built by leveraging
56
53
the [hatch][] project manager, but more about that in the [contributing guide](contributing.md).
57
54
58
-
####Important metadata fields
55
+
### Important metadata fields
59
56
60
57
The `[project]` section in the `pyproject.toml` file defines several important metadata fields that might require editing.
61
58
For example, the `name`, `description`, `authors` fields could need updates as the project evolves.
62
59
Especially, the `version` field needs to be adapted if newer versions of the package are to be released.
63
60
See {ref}`vcs-based-versioning` for more details.
64
61
65
-
####Dependency management
62
+
### Dependency management
66
63
67
64
Package dependencies can be added to the `dependencies` of the `[project]` section.
68
65
You can constrain versions using any of `>=`, `>`, `<`, `<=`, `==`, `!=`, and `~=`.
@@ -72,7 +69,7 @@ As another example, if there is a known buggy version, you could exclude it like
72
69
Further optional dependencies are defined in the `[project.optional-dependencies]` section such as dependencies only for tests (`test`).
73
70
All dependencies listed in such optional dependency groups can then be installed by specifying them like: `pip install <package-name>[test]`.
74
71
75
-
####Tool configurations
72
+
### Tool configurations
76
73
77
74
The `pyproject.toml` file also serves as single configuration file for many tools such as many {ref}`pre-commit`.
78
75
For example, the line length for auto-formatting can be configured as follows:
@@ -84,7 +81,7 @@ line-length = 120
84
81
85
82
[hatch]: https://hatch.pypa.io/latest/
86
83
87
-
###Coverage tests with _Codecov_
84
+
## Coverage tests with _Codecov_
88
85
89
86
Coverage tells what fraction of the code is "covered" by unit tests,
90
87
thereby encouraging contributors to [write tests](contributing.md#writing-tests).
@@ -102,7 +99,7 @@ To set it up, simply go to the [codecov app][] page and follow the instructions
We recommend using [readthedocs.org][] (RTD) to build and host the documentation for your project.
108
105
To enable readthedocs, head over to [their website][readthedocs.org] and sign in with your GitHub account.
@@ -123,7 +120,7 @@ See a guide [here](https://docs.readthedocs.io/en/stable/guides/importing-privat
123
120
124
121
(github-actions)=
125
122
126
-
###Github Actions
123
+
## Github Actions
127
124
128
125
[GitHub Actions][] is a continuous integration (CI)/continuous development (CD) automation tool that enables workflows for building, testing, and deploying code directly from a GitHub repository.
129
126
It uses YAML-based configuration files to define jobs and steps, which can be triggered by events like pushes, pull requests, or scheduled runs.
@@ -148,7 +145,7 @@ There you can see the execution history, logs, and (re-)trigger workflows manual
148
145
(automating-pypi-released-using-github-actions)=
149
146
(configuring-the-github-workflow)=
150
147
151
-
###Automating the PyPI release using GitHub actions
148
+
## Automating the PyPI release using GitHub actions
152
149
153
150
Tags adhering to `"*.*.*"` that are pushed to the `main` branch will trigger the release Github workflow that automatically builds and uploads the Python package to [PyPI][].
154
151
@@ -170,15 +167,15 @@ For more details, please refer to the official [PyPI guide for setting up truste
170
167
171
168
(pre-commit)=
172
169
173
-
###Pre-commit checks
170
+
## Pre-commit checks
174
171
175
172
[Pre-commit][] checks are fast programs that check code for errors, inconsistencies and code styles, before the code is committed.
176
173
177
174
This template uses a number of pre-commit checks.
178
175
In this section we'll detail what is used, where they're defined, and how to modify these checks.
179
176
180
177
181
-
####Pre-commit CI
178
+
### Pre-commit CI
182
179
183
180
We recommend setting up [pre-commit.ci][] to enforce consistency checks on every commit and pull-request.
184
181
@@ -189,7 +186,7 @@ You may choose to enable the service for an entire organization or on a per-repo
189
186
Once authorized, pre-commit.ci should automatically be activated.
190
187
191
188
192
-
####Overview of pre-commit hooks used by the template
189
+
### Overview of pre-commit hooks used by the template
193
190
194
191
The following pre-commit hooks are for code style and format:
195
192
@@ -230,19 +227,19 @@ The following pre-commit hooks are for errors and inconsistencies:
0 commit comments