Creating a new release
This is an advanced developer section that describes creation of a new release for cellmaps_pipeline and deploying that release onto PyPi
Note
THESE INSTRUCTIONS ARE FOR DOING A RELEASE ONLY AND NOT FOR REGULAR COMMITS
Warning
Releases should be done from main_ branch
Testing
Before deploy verify code is working by invoking:
make coverage
The above command runs the unit tests and calculates code coverage of the unit tests.
To just run tests:
make test
All tests should pass
make lint
Lint should not complain
Note
To run tests that exercise the enter package see Integration testing
Committing code
Before doing a release, the code must be assigned a new Versioning Scheme
First run git tag to find the latest version. Pick the next highest version number. The tags in github start with v because versions cannot start with numeric value.
git tag example:
$ git tag
v0.2.0
v0.3.0
v0.4.0
Note
Versions should adhere to this Versioning Scheme
Be sure to update the version in cellmaps_pipeline/__init__.py
Omit the v
when setting the version in the file.
Commit the above changes and push to main:
git commit -m 'message...' cellmaps_pipeline/__init__.py
git push origin main
Tagging code
Now tag source with version:
git tag -a v0.4.0 -m 'Information describing release'
Push the tag to github:
git push origin v0.4.0
Verify unit tests pass on Travis
Click on this link Travis and verify unit tests are passing for the new version committed in the previous step. If not fix issues and start over at the top.
The tag should be visible from github now. If not something is wrong.
Create distributable binaries
From cellmaps_pipeline source tree generate the wheel and tar.gz files
make dist
Under dist/
will be files such as these:
$ tree
dist
|-- cellmaps_pipeline-0.1.0-py2.py3-none-any.whl
`-- cellmaps_pipeline-0.1.0.tar.gz
Documenting release on Github
Be sure to add release notes to HISTORY.rst file in source tree and be sure the text is in restructured text format otherwise it will fail to install on PyPI. To check text paste it into this site
From https://github.com/idekerlab/cellmaps_pipeline click on releases link.
Click on the Draft a new release button.
In the Tag version field select the version set above.
Enter a release title and describe changes in release copying notes put into HISTORY.rst.
Attach distributable binaries created above to release via the Attach binaries link on the page.
Click publish release.
Deploy to test pypi
First deploy to pypi test server by running this:
make testrelease
Note
The above requires one to have accounts on Test PyPI serverand a credential file setup in your home directory. See Expected configuration for .pypirc file for more information.
Once the above is done verify deploy was successful by browsing to https://testpypi.python.org/pypi/cellmaps_pipeline and verifying new release was deployed.
Also test the package by installing it locally by running this:
pip install -i https://testpypi.python.org/pypi cellmaps_pipeline
Note
If there is a problem a new version will need to be tagged in source tree cause pypi does not allow updating of deployed versions.
Deploy to PyPi
If the above works perform the formal release by running:
make release
Note
The above requires one to have accounts on PyPi server and a credential file setup in your home directory. See Expected configuration for .pypirc file for more information.
pip install cellmaps_pipeline