Skip to content

Release procedure

John McGehee edited this page Nov 12, 2017 · 24 revisions

This article shows developers how to prepare a release for pyfakefs. Ordinary users will not be interested in this article.

The pyfakefs package is released on PyPi.

PyPi Procedure

Decide on a new version "M.mm" according to semantic versioning.

On your local computer, clone or pull branch master of pyfakefs. Check out a new branch version-M.mm:

git checkout -b version-M.mm

Edit CHANGES.md with descriptions of the new features and bug fixes.

Make sure that pyfakefs/fake_filesystem.py attribute __version__ is the correct version number:

__version__ = 'M.mm'

Run the tests:

./all_tests.py

Git add, commit.

Push your branch to GitHub:

git push --set-upstream origin version-M.mm

Wait until Travis says your branch passes the tests.

Go to the pyfakefs project on github.com. Create a Pull Request for your release branch.

Wait for Travis to say your pull request passes the tests.

Return to your local computer. If necessary, set up for PyPi according to this article on releasing to PyPi.

Make sure pypandoc is installed locally before registering the package:

pip install pypandoc

If the above command does not properly install pandoc on your platform, consult the Pandoc Installation Instructions.

As described in the above PyPi setup article, release on PyPI:

python setup.py register -r pypi
python setup.py sdist upload -r pypi

Note: the first command may give you the error:

This API is no longer supported, instead simply upload the file.

In this case, just proceed to the second step.

Check that pyfakefs is now live on PyPi. In particular, try downloading the tarball and examine it for some representative change present only in the new release.

GitHub Procedure

After releasing on PyPi, also create a release on GitHub so that we have a record of the exact commit that was released.

On GitHub, go to Release.

Choose a version tag of the format vM.mm, where M.mm is the version number. Enter this name.

Choose the release branch version-M.mm. You may wonder why the tag and branch have different names that express the same thing. This is because git tag names and branch names are often in the same name space. With different names, tag vM.mm and branch version-M.mm are easily distinguished.

Explain the contents of the release, and release it!

Prepare master for the next release

Return to branch master:

git checkout master
git pull

Edit pyfakefs/fake_filesystem.py attribute __version__ with the new version number M.nn, where nn=mm+1:

__version__ = 'M.nn'

Edit CHANGES.md, add the template for the upcoming release:

## Version M.nn (as yet unreleased)

Python 2.6 support ceases in this version.  Having said that, it is the unit
tests that no longer work with Python 2.6.  While not guaranteed, pyfakefs
functional code will likely continue to work with Python 2.6.

#### New Features

#### Infrastructure

#### Fixes
Clone this wiki locally