Skip to content
This repository has been archived by the owner on Jul 30, 2020. It is now read-only.

Making a release of mazer

Adrian Likins edited this page Mar 28, 2019 · 7 revisions

Overview

To release a new version of mazer, the steps are:

  1. Update SPDX data
  2. Commit any SPDX data updates to git
  3. Run The Tests
  4. Update README.md, README.rst, and CHANGELOG.rst
  5. Bump the version
  6. Build python packages
  7. Upload new packages to TestPyPI
  8. Upload new packages to PyPI

Update SPDX data

Mazer includes data about SPDX compatible licenses. To update it's bundle data to the latest version:

make dev/spdx-update

This fetches the data from https://github.com/spdx/license-list-data and creates a condensed version of it. This should modify data/spdx_licenses.json and ansible_galaxy/data/spdx_licenses.json files.

make dev/spdx-update does not commit the new data into git, that is the next step.

Commit any SPDX data updates to git

Commit the new data to git:

git commit data/spdx_licenses.json ansible_galaxy/data/spdx_licenses.json

The changes will be pushed to github when pushing the tagged release as described below.

Run The Tests

Use 'tox' to run the tests.

tox

If they fail, stop and fix the bugs.

Update The READMEs

The README's

README.md is the info shown when viewing the mazer github page.

README.rst is used when build python packages. The info in README.rst will used in the main project description at the PyPI mazer page (https://pypi.org/project/mazer)

CHANGELOG.rst is a change log that is also used for PyPI. It's contents will be appended to the README.rst.

Update README.md

Update to include examples of new features, etc. This does not need to include to itemized change log notes since that should be added to CHANGELOG.rst

Update README.rst and CHANGELOG.rst

To verify the format of the rst is valid, install the python package 'readme_renderer'.

'readme_renderer' will add a 'check' command to setup.py. To use:

python setup.py check -r -s

Commit any changes to git.

Bump the version

Mazer uses 'bumpversion' to update the mazer version and to create a git tag for the new version.

bumpversion

See https://github.com/peritus/bumpversion for bumpversion documentation.

If current version is '0.1.0', and the changes since '0.1.0' are 'patch' level changes, to bump the version to '0.1.1':

bumpversion patch

or

make dev/bumpversion-patch

will do the following:

  • Replace the '__version__' value in 'ansible_galaxy/__init__.py' with '0.1.1'
  • Replace setup.py 'version' value with '0.1.1'
  • Replace setup.cfg 'version' value with '0.1.1'
  • commit those changes with the message "Bump version: 0.1.0 → 0.1.1"
  • git tag as 'v0.1.1'

The valid options for 'bumpversion' and the corresponding make targets

bumpversion arg example make target
major the 'X' in 'X.Y.Z' make dev/bumpversion-major
minor the 'Y' in 'X.Y.Z' make dev/bumpversion-minor
patch the 'Z' in 'X.Y.Z' make dev/bumpversion-patch

Push the changes included new tags to github

For an example where the version was bumped to '1.2.3' and the tag created by bumpversion is 'v1.2.3':

To push the files 'bumpversion' updated and committed:

git push origin devel

Then to push the new tag:

git push origin v1.2.3

Build python packages

Build a sdist

python setup.py sdist

Build a wheel

python setup.py bdist_wheel --universal

Upload to Test PyPI

Using twine

Using version 0.1.0 as an example:

twine upload --repository-url https://test.pypi.org/legacy/ --username ansible "dist/mazer-0.1.0.tar.gz" "dist/mazer-0.1.0-py2.py3-none-any.whl"

Upload to PyPI

Using twine

Using version 0.1.0 as an example:

twine upload --username ansible "dist/mazer-0.1.0.tar.gz" "dist/mazer-0.1.0-py2.py3-none-any.whl"