Skip to content

Commit c978f88

Browse files
authored
Merge pull request #415 from peopledoc/maintainers-documentation
Added a thorough documentation for maintainers
2 parents cae4040 + 6779a81 commit c978f88

File tree

4 files changed

+152
-4
lines changed

4 files changed

+152
-4
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,18 @@ This PR closes #<!-- issue number -->
1717
* [ ] Change `formidable.version` with the appropriate tag
1818
* [ ] Amend `CHANGELOG.rst` (check the release date)
1919
* [ ] *If the version deprecates one or more feature(s)* check the docs `deprecations.rst` file and change it if necessary.
20-
* [ ] DON'T FORGET TO MAKE THE "BACK TO DEV COMMIT"
20+
* [ ] Commit this as "Release x.y.z"
21+
* [ ] Push this commit and wait for CI to be green
2122
* [ ] Tag the appropriate commit with the appropriate tag (i.e. not the "back to dev one")
22-
* [ ] Merge (fast forward is nice)
23+
* [ ] DON'T FORGET TO MAKE THE "BACK TO DEV COMMIT"
24+
* [ ] Your PR should be ready at this stage, wait for complete review.
25+
26+
**Once the PR is reviewed**
27+
28+
* [ ] Merge using Github or `git checkout master && git merge --ff my-release-branch` (fast forward is nice, even if not required)
2329
* [ ] Push the tag (using: `git push --tags`)
2430
* [ ] Edit the release (copy/paste CHANGELOG)
25-
* [ ] Publish the new release to PyPI
26-
31+
* [ ] Generate the release files **using the tagged commit**
32+
* [ ] Publish the new release to PyPI using `twine upload`
33+
* [ ] Delete the release branch
2734
-->

CHANGELOG.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ master (unreleased)
77

88
- Added a tox job target to create a Django model graph using `dot`. Run `tox -e django_graph` to see the result. Since the database schema doesn't change that often, this tox target won't be associated with automated tests or doc generation - it's probably going to be a one-shot.
99
- Add/Confirm support of Django REST Framework 3.11 (#417).
10+
- Added a thorough documentation for maintainers
1011

1112
Release 7.0.0 (2021-03-11)
1213
==========================

docs/source/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Contents:
1717
translations
1818
deprecations
1919
external-field-plugins
20+
maintainers
2021

2122
Indices and tables
2223
==================

docs/source/maintainers.rst

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
==========================
2+
Maintainers' documentation
3+
==========================
4+
5+
How to release
6+
==============
7+
8+
The contents of this section is a detailed version of the "release" part of the :file:`.github/PULL_REQUEST_TEMPLATE.md` file.
9+
10+
Requirements
11+
------------
12+
13+
You can use a dedicated virtualenv, or install the following in your userspace, but these should be available in your ``$PATH``:
14+
15+
* Python3 (any version)
16+
* `twine <https://pypi.org/project/twine/>`_
17+
18+
Pre-release
19+
-----------
20+
21+
* Create a branch with an adequate name, such as ``release/x.y.z``.
22+
* Edit the :file:`formidable/__init__.py` source file and change the value of ``formidable.version`` to the appropriate version number.
23+
* Amend the :file:`CHANGELOG.rst` file to reflect your change. Put there the version number, the date, and do not hesitate to re-arrange its content if needed (e.g.: put sub-sections in the release notes).
24+
* *If the version deprecates one or more feature(s)* check the docs :file:`deprecations.rst` file and change it if necessary.
25+
* Check if you have to edit other files and change them accordingly (e.g.: README).
26+
27+
Commit
28+
++++++
29+
30+
Once your content is ready, **commit it**:
31+
32+
.. code::
33+
34+
git commit -am "Release x.y.z"
35+
36+
If you want, you can also make a more detailed commit message, by copying/pasting the contents of the Changelog.
37+
38+
Push
39+
++++
40+
41+
**Push your branch** on Github and wait for the CI to return green.
42+
43+
You can also start to **create your Pull-Request** at this point, and check if you are at the correct step in the "Release" checklist.
44+
45+
.. attention:: When to tag?
46+
47+
If you are very confident, you can tag here. But we'd recommend to wait to be sure that you have everything sorted out.
48+
49+
Back to development
50+
+++++++++++++++++++
51+
52+
* Edit the :file:`CHANGELOG.rst` file to add a "master (unreleased)" section, with a dummy log item, such as "Nothing to see here yet".
53+
* Edit the :file:`formidable/__init__.py` source file and put a non-release version number, such as ``x.y+1.0.dev0``.
54+
* Commit this change with, for example, the following command: ``git commit -a -m "Back to dev => x.y+1.0.dev0"``
55+
56+
Again, push the branch and wait for the tests to be green.
57+
58+
**At this point, the pull-request should be ready for review**.
59+
60+
Release
61+
-------
62+
63+
If the CI has returned a successful result, and your peers have reviewed your PR, you're ready to proceed with the release.
64+
65+
Tag the right commit
66+
++++++++++++++++++++
67+
68+
You should have two commits in your log corresponding to your latest changes:
69+
70+
.. code:: shell
71+
72+
$ git log --pretty=format:'%h %ad | %s' --date=short -n 2
73+
8fd30ec 2021-04-29 | Back to dev => x.y+1.0.dev0
74+
5b65073 2021-04-29 | Release x.y.0
75+
76+
Checkout to the "Release" commit and tag it.
77+
78+
.. code:: shell
79+
80+
$ git checkout 5b65073
81+
$ git tag x.y.0
82+
83+
This tag can be pushed to Github with:
84+
85+
.. code:: shell
86+
87+
$ git push --tags
88+
89+
Generate files
90+
++++++++++++++
91+
92+
Now you can generate the files using the following command at the root of the project:
93+
94+
.. code:: shell
95+
96+
$ python3 setup.py sdist bdist_wheel
97+
98+
This should produce two files:
99+
100+
* :file:`dist/django-formidable-x.y.0.tar.gz`
101+
* :file:`dist/django_formidable-x.y.0-py3-none-any.whl`
102+
103+
Merge the Pull Request
104+
++++++++++++++++++++++
105+
106+
Merge from Github, or, if you dislike merge commits, type the following commands from your local copy:
107+
108+
.. code:: shell
109+
110+
$ git checkout master
111+
$ git merge --ff release/x.y.z
112+
$ git push
113+
114+
Upload to PyPI
115+
++++++++++++++
116+
117+
In order to upload to PyPI, you should have an account and have at least the *maintainer* or *owner* role for this project **and** have your :file:`.pypirc` correctly configured to upload files (i.e. have the pypi repository as default and correct credentials, using your password or a project token).
118+
119+
Using ``twine`` you may now upload the two files previously generated:
120+
121+
.. code:: shell
122+
123+
twine upload dist/django-formidable-x.y.0.tar.gz dist/django_formidable-x.y.0-py3-none-any.whl
124+
125+
You can then go to https://pypi.org/project/django-formidable/ to check the latest version.
126+
127+
.. hint::
128+
129+
Due to asynchronous tasks and cache invalidation, the latest version may not appear immediately. Be patient.
130+
131+
Post-release
132+
------------
133+
134+
There are a few cleanup tasks, such as:
135+
136+
* Delete the release branch,
137+
* Edit the Release page on Github to reflect the changelog,
138+
* Eventually make some feedback on the issues impacted by the new release,
139+
* Enjoy & celebrate!

0 commit comments

Comments
 (0)