Skip to content

Developers

Jose Borreguero edited this page Jan 17, 2019 · 28 revisions

Table of Contents

TODOs when releasing a new version
Virtual Environment for Testing

TODOs when releasing a new version

  • Create issue X for the release, but work on master branch.

  • Update HISTORY.rst

  • If necessary, update Development Status in setup.py

  • Commit these changes to remote master branch.

  • Triger a manual build (option located under the More options pull-down menu) in Travis of the master branch.

  • Verify readthedocs successfully built the documentation.

  • Update version with bumpversion command. From Semantic Versioning:

Given a version number major.minor.patch, increment the:
major version when you make incompatible API changes,
minor version when you add functionality in a backwards-compatible manner, and
patch version when you make backwards-compatible bug fixes.

File setup.cfg contains the current version of the software. For instance,

[bumpversion]
current_version = 0.1.1
commit = True
tag = True

[bumpversion:file:setup.py]
search = version='{current_version}'
replace = version='{new_version}'

[bumpversion:file:idpflex/init.py]
search = version = '{current_version}'
replace = version = '{new_version}'

If the new version is 0.1.2, then we have to bump the patch number by issuing the command in the terminal:

$>bumpversion patch

will cause the version string to change in files setup.cfg, setup.py, and __init__.py. In addition, it will also create a commit with the changes and a tag (in this case tag v0.1.2)

  • Push to origin.

git push origin
git push origin v0.1.2

  • Triger a manual build (option located under the More options pull-down menu) in Travis of the master branch.
  • Verify readthedocs successfully built the documentation.
  • Upload the package to pypi

python setup.py sdist # creates directory dist/
twine upload dist/idpflex-0.1.2.tar.gz

That's all!

Virtual Environment for Testing

virtual environments with virtualenvwrapper or conda environments is very useful when testing the package against different python versions.

To create a virtualenv for development with python 2.7, run the following commands:

cd to/whereever/you/checked/out/idpflex
cd ../
mkvirtualenv -p /usr/bin/python2.7 idpflex_2.7  # you have executable python2.7 in your path
pip install -e idpflex

The -e flag will cause pip to call setup with the develop option. This means that any changes on the source code will immediately be reflected in your virtual environment. The installation can be done identically in a conda environment.

Clone this wiki locally