1
1
# Developer Documentation
2
+
2
3
## Installing Development Dependencies
3
- Poetry installs dev dependencies by default from the ` poetry.lock ` or ` pyproject.toml ` files. Just run
4
+
5
+ Poetry installs dev dependencies by default from the ` poetry.lock ` or ` pyproject.toml ` files.
6
+
4
7
``` bash
5
8
poetry install
6
9
```
7
10
11
+ Alternatively, if you are using something other than Poetry for development you can install from
12
+ the ` dev ` extras group.
13
+
14
+ ``` bash
15
+ pip install " .[dev]"
16
+ ```
17
+
18
+ Once the development dependencies are installed, you can run
19
+
20
+ ``` bash
21
+ pre-commit install
22
+ ```
23
+
24
+ to get pre-commit hooks to automatically run the linting and formatting checks for you before each commit.
25
+
8
26
## Testing
9
- Testing is run with ` pytest ` and the order is randomized by ` pytest-randomly ` .
27
+ Testing is run with ` pytest ` and the order is randomized by ` pytest-randomly ` .
10
28
To run all tests, run
11
29
``` bash
12
30
pytest tests
@@ -18,15 +36,15 @@ docker-compose up --build && docker-compose down
18
36
```
19
37
20
38
## Building Documentation with Sphinx
21
- Documentation is automatically built on ReadTheDocs in response to every PR and release,
39
+ Documentation is automatically built on ReadTheDocs in response to every PR and release,
22
40
but you can also build it locally with:
23
41
``` bash
24
42
# From docs directory
25
43
make html && open build/html/index.html
26
44
```
27
45
28
46
## Making a Pull Request
29
- Feel free to fork this repo and submit a PR!
47
+ Feel free to fork this repo and submit a PR!
30
48
- If you are working on an issue, link your PR to that issue.
31
49
- All PRs should be destined for the ` main ` branch (trunk-based development).
32
50
- Reviews are required before merging and our automated tests must pass.
@@ -45,7 +63,7 @@ That is,
45
63
46
64
### Preparing for Release
47
65
1 . Create a release candidate branch named according to the version to be released. This branch is used to polish
48
- the release but is fundamentally not different from any other feature branch in trunk-based development.
66
+ the release but is fundamentally not different from any other feature branch in trunk-based development.
49
67
The naming convention is ` release/X.Y.Z ` .
50
68
51
69
2 . Bump the version of the package to the version you are about to release, either manually by editing ` pyproject.toml `
@@ -56,30 +74,30 @@ That is,
56
74
57
75
4 . Update ` changelog.md ` to reflect that the version is now "released" and revisit ` README.md ` to keep it up to date.
58
76
59
- 5 . Open a PR to merge the release branch into main. This informs the rest of the team how the release
60
- process is progressing as you polish the release branch. You may need to rebase the release branch onto
77
+ 5 . Open a PR to merge the release branch into main. This informs the rest of the team how the release
78
+ process is progressing as you polish the release branch. You may need to rebase the release branch onto
61
79
any recent changes to ` main ` and resolve any conflicts on a regular basis.
62
80
63
- 6 . When you are satisfied that the release branch is ready, merge the PR into ` main ` .
81
+ 6 . When you are satisfied that the release branch is ready, merge the PR into ` main ` .
64
82
65
- 7 . Check out the ` main ` branch, pull the merged changes, and tag the newly created merge commit with the
66
- desired version ` X.Y.Z ` and push the tag upstream.
83
+ 7 . Check out the ` main ` branch, pull the merged changes, and tag the newly created merge commit with the
84
+ desired version ` X.Y.Z ` and push the tag upstream.
67
85
68
86
### Automatic Release Process
69
- We use GitHub Actions for automatic release process that responds to pushes of git tags. When a tag matching
70
- a semantic version (` [0-9]+.[0-9]+.[0-9]+* ` or ` test-release/[0-9]+.[0-9]+.[0-9]+* ` ) is pushed,
71
- a workflow runs that builds the package, pushes the artifacts to PyPI or TestPyPI
72
- (if tag is prefixed with ` test-release ` ),
73
- and creates a GitHub Release from the distributed artifacts. Release notes
87
+ We use GitHub Actions for automatic release process that responds to pushes of git tags. When a tag matching
88
+ a semantic version (` [0-9]+.[0-9]+.[0-9]+* ` or ` test-release/[0-9]+.[0-9]+.[0-9]+* ` ) is pushed,
89
+ a workflow runs that builds the package, pushes the artifacts to PyPI or TestPyPI
90
+ (if tag is prefixed with ` test-release ` ),
91
+ and creates a GitHub Release from the distributed artifacts. Release notes
74
92
are automatically generated from commit history and the Release name is taken from the basename of the tag.
75
93
76
94
#### Official Releases
77
95
Official releases are published to the public PyPI (even if they are release candidates like ` 1.2.3rc1 ` ). This differs
78
- from test releases, which are only published to TestPyPI and are not published to GitHub at all.
79
- If the semantic version has any suffixes (e.g. ` rc1 ` ), the release will be marked as
96
+ from test releases, which are only published to TestPyPI and are not published to GitHub at all.
97
+ If the semantic version has any suffixes (e.g. ` rc1 ` ), the release will be marked as
80
98
a prerelease in GitHub and PyPI.
81
99
82
- To trigger an official release, push a tag referencing the commit you want to release. The commit _ MUST_ be on
100
+ To trigger an official release, push a tag referencing the commit you want to release. The commit _ MUST_ be on
83
101
the ` main ` branch. Never publish an official release from a commit that hasn't been merged to ` main ` !
84
102
85
103
``` bash
@@ -90,10 +108,10 @@ git push origin X.Y.Z
90
108
```
91
109
92
110
#### Test Releases
93
- Test releases are published to TestPyPI only and are not published on GitHub. Test releases are triggered by tags
111
+ Test releases are published to TestPyPI only and are not published on GitHub. Test releases are triggered by tags
94
112
prefixed with ` test-release ` .
95
113
96
- To publish a test release, prefix the tag with ` test-release ` . This will prevent any publishing to the public PyPI
114
+ To publish a test release, prefix the tag with ` test-release ` . This will prevent any publishing to the public PyPI
97
115
and will prevent the artifacts being published on GitHub.
98
116
99
117
``` bash
0 commit comments