-
Notifications
You must be signed in to change notification settings - Fork 1
Description
This is just future reference for increasing the version number. I had set it up a while ago, forgot how it worked, and recently wanted to bump it . . . but couldn't figure out how to do it!
Versioning is handled with versioneer. It works by putting a file called _version.py in the package, which knows how to do things like get git commit information. The main reason we're using versioneer is for automatically building conda packages with increased build numbers every time a PR is merged into master.
Versioneer is configured to build a version based on the most recent git tag. To increase the version, we need to create a new git tag, e.g.
git tag -a 0.1.4 -m "v0.1.4"
git push origin 0.1.4We're not storing it anywhere in a file.
When returning a version, versioneer figures out how many commits past the tag we are and appends a .devN to the tag, where N is the number of commits past the tag. In __init__.py, we're grabbing that information to use as a conda build number and storing the info in lcdblib.__conda_version__ and lcdblib.__conda_build__.
When it's time to build in the travis-ci tests, ci/conda-build-and-upload.sh sets that information as env vars just before building. These are then templated in conda-recipe/meta.yaml.
The end result is if we do git tag -a 0.2 -m "v0.2", then make 3 commits after that tag, our version will be 0.2.post.dev3. The built conda package version will be 0.2post and the build number will be 3.
Keep an eye on the Anaconda tokens. They are set to periodically expire; we need to add new ones as the ANACONDA_TOKEN env var in the travis-ci interface.
Uploading docs to https://lcdb.github.io/lcdblib/ is done in ci/build-docs.sh. It checks out the gh-pages branch, builds the docs, and if successful and on the master branch, pushes to github to host the pages. It's allowed to do this because when setting up the repo, the key was encrypted with travis-encrypt, decrypted with openssl aes-256-cbc within build-docs.sh, and added to the github repo's allowed access keys.