Skip to content

Commit 99c483c

Browse files
authored
Release 0.4.0 (#616)
* Update of the Developer documention for describing the procedure to release a new version * Release procedure corrected according to MJGaughran's remarks. * Corrected typo * Clarified the specification of numpy versions used in GitJub actions * Added the ## Main modifications section * corrected typo
1 parent 6cc2bbf commit 99c483c

File tree

1 file changed

+74
-11
lines changed

1 file changed

+74
-11
lines changed

pyat/developers.rst

Lines changed: 74 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,14 @@ To do this, we use the continuous integration service Github Actions.
105105
When a tag of the form pyat-* is pushed to Github, wheels for each
106106
supported platform will be built and automatically uploaded as an 'artifact'.
107107

108+
We use `Semantic Versioning <https://semver.org/>`_ for this project. As documented
109+
by the full specification, we use a version number with three dot-separated
110+
numbers: ``MAJOR.MINOR.PATCH``. Increment the:
111+
112+
* MAJOR version when you make incompatible API changes
113+
* MINOR version when you add functionality in a backward compatible manner
114+
* PATCH version when you make backward compatible bug fixes
115+
108116
Release procedure
109117
-----------------
110118

@@ -114,24 +122,79 @@ To upload a release to PyPI, you will need to be a 'maintainer' of
114122
For testing any version that you have installed, the simple snippet in
115123
``README.rst`` is sufficient.
116124

117-
* Decide the Python versions that should be supported in the release
118-
* Set these Python versions in ``python_requires`` in ``setup.cfg``
119-
* Set at least these Python versions as ``python-version`` in ``.github/workflows/python-tests.yml``
120-
* Determine the minimum Numpy version that is required for those Python versions
121-
* Set this numpy version in ``install_requires`` in ``setup.cfg``
122-
* Push a tag ``pyat-x.y.z`` to Github
125+
Decide the Python versions that should be supported in the release
126+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
127+
128+
* Set these Python versions in ``requires-python`` in ``pyproject.toml``
129+
* Set at least these Python versions as ``python-version`` in ``.github/workflows/python-tests.yml``
130+
131+
Determine the minimum ``numpy`` and ``scipy`` versions:
132+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
133+
134+
* the version ensuring the requirements necessary to **run** PyAT is set in the
135+
``dependencies`` item of the ``[project]`` section of ``pyproject.toml``
136+
* The version required to **build** PyAT is set in the ``requires`` item of the
137+
``[build-system]`` section of ``pyproject.toml``. It depends on the python version
138+
and must be higher or equal to the "run" version.
139+
* To avoid ABI compatibility issues, the pre-compiled binaries are built with the
140+
earliest possible version of numpy for the given Python version. This ensures that
141+
the user's libraries are more recent than the one AT has been compiled with. For
142+
that, a copy of ``pyproject.toml`` named ``githubproject.toml`` is used for
143+
compilation. In this copy, the numpy version specifications are set using ``~=``
144+
instead of minimum (``>=``). Apart from these lines, the 2 files
145+
should be strictly identical.
146+
147+
Prepare the "Release notes"
148+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
149+
A draft can be obtained by creating a new tag on GitHub. Click "Draft a new release"
150+
in the releases page, choose a new tag in the form ``pyat-x.y.z`` with the correct
151+
incremented version number. The ``pyat-`` prefix is necessary to identify python releases.
152+
Select the master branch as target. In the description area, choose the current
153+
release in the "previous tag" pull-down, and press "Generate release notes".
154+
155+
The generated notes can now be copied and edited. You can then either cancel or
156+
save the release as a draft while editing the release notes.
157+
158+
The ``## What's changed`` section should be split into ``## Bug fixes`` and
159+
``## New features``. It must be filtered to keep only the python changes, ignoring
160+
the Matlab ones. The tags on each pull request are there to help in this filtering.
161+
162+
The release notes should start with a ``## Main modifications`` section summarising
163+
the important points of the new release.
164+
165+
They must end with a section pointing out ``## Incompatibilities`` and mentioning the
166+
necessary actions before upgrading to this release.
167+
168+
Open a Pull Request for the new release
169+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
170+
171+
The goal is to make all contributors aware of the new release, to check that no pending
172+
modifications are worth being included and to review the release notes.
173+
174+
There should be no code modifications except updates of version informations in the
175+
documentation. Once the pull request is approved and merged, the release may be built.
176+
177+
178+
Build the release
179+
~~~~~~~~~~~~~~~~~
180+
181+
Now either go back to the draft release saved above, or start again the procedure,
182+
but now finalising with the ``Publish`` button.
123183

124184
If all goes well, there will be a build of "Build and upload wheels and sdist"
125185
associated with the tag ``pyat-x.y.z``: on the `Github Actions page <https://github.com/atcollab/at/actions/workflows/build-python-wheels.yml>`_. This build will have
126186
'tar.gz' and 'wheels' downloads available.
127187

188+
Upload the release to ``pip``
189+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
190+
128191
* Download the tar.gz and wheels files and unzip them into a directory ``<dir>``
129192
* Manually install at least one wheel to make sure that it has built correctly
130-
* Install Twine for uploading the files to PyPI. One way to do this is to create a new virtualenv::
193+
* Install Twine for uploading the files to PyPI. One way is to use
194+
`pipx <https://pypa.github.io/pipx/>`_. Once pipx installed, use::
131195

132-
$ python3 -m venv venv
133-
$ source venv/bin/activate
134-
$ pip install twine
196+
$ pipx install twine # or:
197+
$ pipx upgrade twine
135198

136199
* Use Twine to upload the files to PyPI. You will be prompted for your PyPI credentials::
137200

@@ -145,4 +208,4 @@ associated with the tag ``pyat-x.y.z``: on the `Github Actions page <https://git
145208
Note that 46 different files were uploaded for pyat-0.0.4 covering different
146209
platforms and architectures.
147210

148-
The configuration for this is in .github/workflows/build-python-wheels.yml.
211+
The configuration for this is in ``.github/workflows/build-python-wheels.yml``.

0 commit comments

Comments
 (0)