Skip to content

Release MOP

Joris Roovers edited this page Apr 19, 2016 · 1 revision

Creating a Release

Start by quickly reviewing this page so that you are aware of all steps.

Prepare the code for release

  1. Bump the version number in yamlpal/__init__.py
  2. Update the CHANGELOG.md
  3. Run tests

Test the build

# remove any previous builds
rm -rf dist/
# check whether the builds work
python setup.py sdist bdist_wheel
# Now unzip the source distribution in ```dist/``` and check whether it contains all files

Test upload to testpypi.python.org

Check this blog for good overall instructions: http://peterdowns.com/posts/first-time-with-pypi.html

# remove any previous builds
rm -rf dist/
# Do a rebuild and upload
python setup.py sdist bdist_wheel upload -r pypitest

Test installation of test package

# SSH into Vagrant VM
vagrant up
vagrant ssh
deactivate # deactivate current virtualenv

# Create virtualenv to test the release
mkdir /tmp/release-0.1.0-test
cd /tmp/release-0.1.0-test/
virtualenv -p /usr/bin/python2.7 .venv
source .venv/bin/activate

# Install
yamlpal # should not work
pip install -r requirements.txt # You can't always install dependencies from testpypi. Just make sure the setup.py file contains the same dependencies as requirements.txt
pip install -i https://testpypi.python.org/pypi yamlpal
# Do some basic testing
yamlpal --version # should print the correct version
yamlpal insert -f /vagrant/examples/sample1.yml "date" "foo: bar"
yamlpal find -f /vagrant/examples/sample1.yml "bill-to/address/city"

Release on pypi

# remove any previous builds
rm -rf dist/
# Do a rebuild and upload
python setup.py sdist bdist_wheel upload -r pypi

Test installation of released package

# SSH into Vagrant VM
vagrant up
vagrant ssh
deactivate # deactivate current virtualenv

# Create virtualenv to test the release
mkdir /tmp/release-0.1.0
cd /tmp/release-0.1.0/
virtualenv -p /usr/bin/python2.7 .venv
source .venv/bin/activate

# Install
yamlpal # should not work
pip install yamlpal
# Do some basic testing
yamlpal --version # should print the correct version
yamlpal insert -f /vagrant/examples/sample1.yml "date" "foo: bar"
yamlpal find -f /vagrant/examples/sample1.yml "bill-to/address/city"

Commit and push release commit to github

Template commit message:

0.1.0 release

[copy release notes here]

Full Release details in CHANGELOG.md.

Tag git commit

git tag v0.1.0
git tag --list
git push --tags

Create a new release on git

Go to the releases page and create a new release. Copy in changes from CHANGELOG.md

Bump version to dev

  1. Bump the version number in yamlpal/__init__.py