HOW to release a version¶
In this section I will describe the procedure to make a release (create
a new version of the code and publish it), and the management commands
that we use for that (git
, flit
, etc).
Let us assume that we want to implement a new feature. Say that we are
going to create a replacement for the ccs
program. The following is
an overview of the necessary steps to make the release:
Create a feature branch:
git flow feature start own-ccs
(Hopefully not very) long cycles of double loop TDD to implement the feature (see Testing).
When the feature is ready, ensure that the tests pass:
tox
Finish the branch:
git flow feature finish own-ccs
as a result you will land in the
develop
branch.Merge the new feature into
master
:git checkout master git merge develop
Fix whatever is needed in the documentation. At the very minimum, think at least about these docs:
CHANGELOG.rst
docs/roadmap.rst
Set the new version:
bump2version "part"
where
part
is one of:patch
,minor
ormajor
. For instance:bump2version minor
to increase the minor digit of the version. Versions are:
major.minor.patch
such that in, eg:
1.0.2
major is
1
, minor is0
and patch is2
.Upload the changes to the repo:
git push
this will trigger the pipelines in gitlab and update the docs in readthedocs.
Publish the code in PyPI:
flit publish
Merge the changes into
develop
and keep working:git checkout develop git merge master
The above steps are only an minimal example. Probably a release is made of many features.