Skip to content

Commit d676f94

Browse files
authored
DOC add release process (#806)
1 parent a55deec commit d676f94

File tree

1 file changed

+71
-6
lines changed

1 file changed

+71
-6
lines changed

doc/developers_utils.rst

Lines changed: 71 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
.. _developers-utils:
22

3-
========================
4-
Utilities for Developers
5-
========================
3+
===================
4+
Developer guideline
5+
===================
6+
7+
Developer utilities
8+
-------------------
69

710
Imbalanced-learn contains a number of utilities to help with development. These are
811
located in :mod:`imblearn.utils`, and include tools in a number of categories.
@@ -17,7 +20,7 @@ All the following functions and classes are in the module :mod:`imblearn.utils`.
1720
1821
1922
Validation Tools
20-
================
23+
~~~~~~~~~~~~~~~~
2124

2225
.. currentmodule:: imblearn.utils
2326

@@ -33,7 +36,7 @@ should be used when applicable.
3336

3437

3538
Deprecation
36-
===========
39+
~~~~~~~~~~~
3740

3841
.. currentmodule:: imblearn.utils.deprecation
3942

@@ -103,7 +106,7 @@ provides :func:`deprecate_parameter`: which is used to deprecate a sampler's
103106
parameter (attribute) by another one.
104107

105108
Testing utilities
106-
=================
109+
~~~~~~~~~~~~~~~~~
107110
Currently, imbalanced-learn provide a warning management utility. This feature
108111
is going to be merge in pytest and will be removed when the pytest release will
109112
have it.
@@ -144,3 +147,65 @@ that the exception matches a text or regex::
144147
Traceback (most recent call last):
145148
...
146149
AssertionError: 'must be \d+$' pattern not found in ['this is not here']
150+
151+
Making a release
152+
----------------
153+
This section document the different steps that are necessary to make a new
154+
imbalanced-learn release.
155+
156+
Major release
157+
~~~~~~~~~~~~~
158+
159+
* Update the release note `whats_new/v0.<version number>.rst` by giving a date
160+
and removing the status "Under development" from the title.
161+
* Run `bumpversion release`. It will remove the `dev0` tag.
162+
* Commit the change `git commit -am "bumpversion 0.<version number>.0"`
163+
(e.g., `git commit -am "bumpversion 0.5.0"`).
164+
* Create a branch for this version
165+
(e.g., `git checkout -b 0.<version number>.X`).
166+
* Push the new branch into the upstream remote imbalanced-learn repository.
167+
* Change the `symlink` in the
168+
`imbalanced-learn website repository <https://github.com/imbalanced-learn/imbalanced-learn.github.io>`_
169+
such that stable points to the latest release version,
170+
i.e, `0.<version number>`. To do this, clone the repository,
171+
`run unlink stable`, followed by `ln -s 0.<version number> stable`. To check
172+
that this was performed correctly, ensure that stable has the new version
173+
number using `ls -l`.
174+
* Return to your imbalanced-learn repository, in the branch
175+
`0.<version number>.X`.
176+
* Create the source distribution and wheel: `python setup.py sdist` and
177+
`python setup.py bdist_wheel`.
178+
* Upload these file to PyPI using `twine upload dist/*`
179+
* Switch to the `master` branch and run `bumpversion minor`, commit and push on
180+
upstream. We are officially at `0.<version number + 1>.0.dev0`.
181+
* Create a GitHub release by clicking on "Draft a new release" here.
182+
"Tag version" should be the latest version number (e.g., `0.<version>.0`),
183+
"Target" should be the branch for that the release
184+
(e.g., `0.<version number>.X`) and "Release title" should be
185+
"Version <version number>". Add the notes from the release notes there.
186+
* Add a new `v0.<version number + 1>.rst` file in `doc/whats_new/` and
187+
`.. include::` this new file in `doc/whats_new.rst`. Mark the version as the
188+
version under development.
189+
* Finally, go to the `conda-forge feedstock <https://github.com/conda-forge/imbalanced-learn-feedstock>`_
190+
and a new PR will be created when the feedstock will synchronizing with the
191+
PyPI repository. Merge this PR such that we have the binary for `conda`
192+
available.
193+
194+
Bug fix release
195+
~~~~~~~~~~~~~~~
196+
197+
* Find the commit(s) hash of the bug fix commit you wish to back port using
198+
`git log`.
199+
* Checkout the branch for the lastest release, e.g.,
200+
`git checkout 0.<version number>.X`.
201+
* Append the bug fix commit(s) to the branch using `git cherry-pick <hash>`.
202+
Alternatively, you can use interactive rebasing from the `master` branch.
203+
* Bump the version number with bumpversion patch. This will bump the patch
204+
version, for example from `0.X.0` to `0.X.* dev0`.
205+
* Mark the current version as a release version (as opposed to `dev` version)
206+
with `bumpversion release --allow-dirty`. It will bump the version, for
207+
example from `0.X.* dev0` to `0.X.1`.
208+
* Commit the changes with `git commit -am 'bumpversion <new version>'`.
209+
* Push the changes to the release branch in upstream, e.g.
210+
`git push <upstream remote> <release branch>`.
211+
* Use the same process as in a major release to upload on PyPI and conda-forge.

0 commit comments

Comments
 (0)