@@ -4,79 +4,153 @@ Release process
44Target audience
55---------------
66
7- This document is aimed toward established contributors the project.
8-
7+ This document is aimed at established contributors to the project.
98
109Process
1110-------
1211
13- Going further, we assume you have write-access to both the repository
14- and the PyPI project page.
12+ Going further, we assume you have write-access to both the repository, PyPI and
13+ conda-forge project page.
14+
15+ .. note :: We follow scikit-learn versioning conventions:
16+
17+ - Major/Minor releases are numbered X.Y.0.
18+ - Bug-fix releases are done as needed between major/minor releases and only apply to
19+ the last stable version. These releases are numbered X.Y.Z.
20+
21+ To release a new minor version of skrub (e.g., from 0.1.0 to 0.2.0), here are the main
22+ steps and appropriate resources: the main steps and appropriate resources:
23+
24+ Preparing the release branch
25+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
26+
27+ - Create the ``0.2.X `` branch, branching from upstream/main, and push it upstream
28+ (it may already exist). You can also use the GitHub UI to create the branch if you
29+ disabled ``git push upstream `` in your local git config.
30+ - Edit CHANGES.rst: replace "ongoing development" with ``0.2.0 ``
31+ - Edit VERSION.txt: replace ``0.2.dev0 `` with ``0.2.0 ``
32+ - Build the wheel and test it:
33+
34+ - ``rm -r dist skrub.egg-info ``
35+ - ``python -m build `` (may need ``pip install build ``)
36+ - ``twine check dist/* `` (may need ``pip install twine ``)
37+ - In a directory outside of the skrub repo:
38+
39+ - Install the wheel in a fresh virtualenv
40+ - Run all tests with ``pytest --pyargs skrub ``
41+
42+ - git commit the changes done to CHANGES.rst and VERSION.txt
43+ - If we are doing a bugfix release (``0.2.X `` already existed before) we need to rebase
44+ on the existing ``0.2.X ``.
45+
46+ - Run ``git rebase -i upstream/0.2.X ``
47+ - All commits that have been made on main that we want to keep will be replayed on
48+ top of the last release's tag in ``0.2.X ``.
49+
50+ - Open a PR targeting ``0.2.X ``. This will update the doc for the stable release. While
51+ the update runs, we can prepare a PR on the main branch to be merged after the
52+ release, see the next section.
53+
54+ Meanwhile, preparing the post-released PR
55+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
56+
57+ - For a major/minor (not a patch) release:
58+ - VERSION.txt: update to ``0.3.dev0 `` (the next minor).
59+ - CHANGES.rst: create a header for the new entries ("ongoing development").
60+ - doc/version.json: update the version numbers of the stable release and dev branch.
61+
62+
63+ The doc update has succeeded
64+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
65+
66+ - Merge the PR targeting ``0.2.X ``, **without squashing the commits **.
67+
68+ .. warning ::
69+
70+ This PR should be merged with the rebase mode instead of the usual squash mode
71+ because we want to keep the history in the ``0.2.X `` branch close to the history of
72+ the main branch, which will help for future bug fix releases.
73+
74+ By default, only the squash & merge option is available to merge PRs on the main
75+ branch. So, when releasing, we need to temporarily enable the rebase option.
76+ To do so, head to Settings -> General -> Pull request, enable rebasing, merge the
77+ PR targeting ``0.2.X `` with the rebase option, then disable the setting again.
78+
79+ - Check the rendering of the doc for the built ``0.2.X `` branch, the examples and the
80+ changelog. Ideally, we should go over all features and double check that the docs are
81+ being rendered correctly, because issues there often go unnoticed.
82+
83+
84+ Next, we'll build the wheel and push it to Pypi!
85+
86+
87+ Pushing the wheel to Pypi
88+ ^^^^^^^^^^^^^^^^^^^^^^^^^
89+
90+ - Checkout to the release candidate branch:
91+
92+ .. code :: shell
93+
94+ git fetch upstream
95+ git checkout upstream/0.2.X
96+
97+ - Build the wheel and test it:
98+
99+ - ``rm -r dist skrub.egg-info ``
100+ - ``python -m build `` (may need ``pip install build ``)
101+ - ``twine check dist/* `` (may need ``pip install twine ``)
102+ - In a directory outside of the skrub repo:
103+
104+ - Install the wheel in a fresh virtualenv
105+ - Run all tests with ``pytest --pyargs skrub ``
106+
107+ - If test passed successfully, upload to Pypi: ``twine upload dist/* ``.
108+ - Tag the release commit and push the tag:
109+
110+ - ``git tag -s '0.2.0' ``, ``-s `` is for signing and is optional.
111+ - ``git push upstream tag 0.2.0 ``
112+
113+ - Check that your version is now on Pypi.
114+ - Merge the post-release PR
115+ - For major/minor releases only, in the documentation branches repository
116+ https://github.com/skrub-data/skrub-data.github.io, update the documentation symlink
117+ to stable version, here from 0.1 to 0.2:
118+
119+ .. code :: shell
120+
121+ rm stable
122+ ln -s 0.2 stable
123+
124+ ``stable `` should point on the latest number release.
125+
126+
127+ Update the conda-forge recipe
128+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
129+
130+ - Create the branch ``release-0.2.0 `` in
131+ `skrub-feedstock <https://github.com/conda-forge/skrub-feedstock >`_
132+ - Edit ``recipe/meta.yml ``, which is the only file we edit manually in that repo:
133+ - Update the version number.
134+ - Update the sha256 using Pypi hash.
135+ - If needed, reset the build number to 0.
136+ - If needed, update the requirements.
137+
138+ - Check the new requirements with:
139+
140+ .. code :: shell
141+
142+ git checkout 0.2.0
143+ git diff 0.1.0 -- pyproject.toml
144+
145+ - Open a PR targeting ``upstream/skrub-feedstock `` main branch.
146+ - Use the the checklist posted in the PR template. In particular, it asks to post a
147+ comment asking a bot to re-render the recipe. Make sure to wait until it has finished.
148+ - Merge the PR. It takes up to an hour for the package to be available from the
149+ conda-forge channel.
150+ - When it becomes available, install it in a fresh environment and run tests.
15151
16152.. note ::
17153
18- It is useful to publish a beta version of the package before the
19- actual one.
20-
21- To release a new minor version of ``skrub `` (e.g. 0.1.0 -> 0.2.0), here are
22- the main steps and appropriate resources:
23-
24- 1. Update ``skrub/CHANGES.rst ``. It should be updated at each PR,
25- but double-checking before the release is good practice.
26- 2. Create a branch by running ``git checkout -b 0.<version>.X ``
27- (e.g. ``0.2.X ``).
28- 3. Update ``skrub/skrub/VERSION.txt `` with the new version
29- number (e.g. ``0.2.0 ``).
30- 4. Update ``skrub/setup.cfg `` (e.g. Python version supported and dependencies).
31- 5. Commit the changes with a new tag: the version you're going to push,
32- with the commands ``git commit -m "Bump to version 0.2.0" `` and
33- ``git push origin 0.2.0 ``.
34- Push the branch to the ``skrub `` repository.
35- The CI will automatically create an associated folder in the documentation repo.
36- 6. In the documentation repository (e.g. ``https://github.com/skrub-data/skrub-data.github.io ``),
37- update the ``stable `` symlink to the latest stable version: first, unlink ``stable ``
38- (i.e. ``unlink stable ``); then, create a new symlink (i.e. ``ln -s 0.2 stable ``);
39- finally, commit and push the changes into the repository.
40- 7. Create a new release via GitHub: ``https://github.com/skrub-data/skrub/releases/new ``.
41- Provide the tag using the current version, e.g. ``0.2.0 `` and make sure to select
42- the target branch created earlier (e.g. ``0.2.X ``).
43- 8. Next, you will need to install the ``twine `` and ``setuptools `` packages with
44- ``pip install --upgrade twine setuptools ``.
45- 9. Build the source with ``python setup.py bdist_wheel sdist ``
46- 10. `Check if today is a good day for releasing <https://shouldideploy.today/ >`__
47- 11. It is advised to first push the version on the test package index
48- ``test.pypi.org `` before the official package index ``pypi.org ``.
49- You can do this with the command
50- ``twine upload dist/* --repository-url https://test.pypi.org/legacy/ ``
51- This is useful to test if the build done by twine and the push to
52- the package indexer is working.
53- 12. Install the new release from the test package index on a dedicated
54- environment with the command
55- ``pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://test.pypi.org/simple/skrub ``.
56- If there are other package install errors, it probably means those packages are not on test.pypi.org.
57- Download them from pypi.org directly with just ``pip install ``.
58- 13. Finally, if that works fine, you can push to the official package
59- index with ``twine upload dist/* ``
60- 14. It is also good practice at this point to create a new environment
61- and try installing and using the library (for example by launching examples).
62- Be sure to install it with the command ``pip install skrub==<version> ``
63- (e.g. ``pip install skrub==0.2.0 ``), otherwise some package/env managers
64- such as conda might use a cached version.
65- 15. Set package version to ``<next_version>.dev0 ``, commit and push.
66-
67- For the bug fix release (e.g. 0.2.0 -> 0.2.1), the process is similar. You don't need
68- to create the branch ``0.2.X `` because it exists already. You need to cherry-pick the
69- commits from ``main `` into this branch and then follow the same steps as above:
70- bumping the version, update the setup, commit and push the changes and finally create
71- and update the wheel.
72-
73- Resources
74- ---------
75-
76- - `Packaging and distributing software - Python Packaging User
77- Guide <https://packaging.python.org/guides/distributing-packages-using-setuptools/> `__
78- - `Publishing (Perfect) Python Packages on
79- PyPi <https://youtu.be/GIF3LaRqgXo> `__
80- - `Managing releases in a
81- repository <https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository> `__
82- - `Should I deploy today? <https://shouldideploy.today/ >`__
154+ You can add new maintainers to that repo by listing them at the end of meta.yml.
155+
156+ - If the new recipe works fine, announce the release on social network channels 🎉!
0 commit comments