Steps to follow to release a new version of pyIATI.
- In the
dev
branch.- Ensure license information for any new dependencies has been added to
LICENSES-3RD-PARTY.txt
. - Read the README to ensure it is up-to-date (if it isn't, fix it).
- Ensure pyIATI includes the latest relevant version of SSOT content.
- Ensure that all relevant Pull Requests have been merged into
dev
. - Ensure the
Unreleased
section inCHANGELOG.md
covers all changes betweendev
andmaster
. - Ensure all lines under
Unreleased
inCHANGELOG.md
include a reference to a Pull Request or Issue. - Prepare the release. You will need a new pull request for these steps:
- Bump the version, as per SemVer. Run one of the following as appropriate:
- If the changes are bug fixes only:
bumpversion patch
- If new features are added:
bumpversion minor
- There MUST NOT be a
major
version increase (to1.0.0
) until a suitable amount of functionality is stable and tested.
- If the changes are bug fixes only:
- Move content under
Unreleased
inCHANGELOG.md
to a new section, with a heading in the format:[version-number] - yyyy-mm-dd
. - Ensure a blank
Unreleased
section is left inCHANGELOG.md
(see later in doc for template).
- Bump the version, as per SemVer. Run one of the following as appropriate:
- Merge
dev
intomaster
.
- Ensure license information for any new dependencies has been added to
- On the
master
branch.- Create a new Github Release.
- Title:
v{{version-number}}
- Content: The relevant section from
CHANGELOG.md
- Create a new tag called:
v{{version-number}}
, targetmaster
- Title:
- Create a new Github Release.
- Download and check that the release is safe to be published
- Download the
.zip
or.tar.gz
source code for the release on the Releases page. - Unzip/uncompress, enter into the folder, follow the instructions to set-up a development environment.
- Run the tests to check that the package is safe for release, how to run the tests.
- Download the
- If the tests passed: Publish to PyPi
- Install tools required for deployment:
apt-get install python3-setuptools; pip install twine
- Check that you have the iati login credentials for the PyPi test and production instances in a
~/.pypirc
file. A template file is below. See here for an explanation of the file. - From within the folder extracted from the zip file:
- Ensure you have at least version 1.8 of twine:
twine --version
- If you have an older version of twine (eg. when using Ubuntu 16.04 LTS), obtain a more recent version
- Package the release ready to upload to PyPi:
python setup.py sdist
- Upload to the PyPi test server:
twine upload dist/* -r pypi-test
- Ensure you have at least version 1.8 of twine:
- Test installation from the PyPi test server:
- Create and activate a clean virtualenv:
deactivate; mkdir pyIATItest; cd pyIATItest; virtualenv -p python3 pyenv;source pyenv/bin/activate
- Install pyIATI:
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple pyIATI
– this will installpyIATI
from the test PyPi, but other dependencies (e.g.lxml
and others) from the production server - Ensure that all is well by running
pip freeze
. If the latest version of pyIATI is present, all is well.
- Create and activate a clean virtualenv:
- Publish to production PyPi:
- Change back to the virtualenv from the unzipped folder.
- Upload to the PyPi production server:
twine upload dist/* -r pypi-production
- The package is now published and you can now run
pip install pyIATI
to download pyIATI!
- Install tools required for deployment:
This template should be used to keep track of unreleased changes in CHANGELOG.md
.
## [Unreleased]
### Added
### Changed
### Deprecated
### Removed
### Fixed
### Security
[distutils]
index-servers =
pypi-production
pypi-test
[pypi-production]
username=iati
password=[PASSWORD_HERE]
[pypi-test]
repository: https://test.pypi.org/legacy/
username=iati
password=[PASSWORD_HERE]