Follow these steps to release a new version.
- Make sure things have been tested... we've got to add some tests!
- Summarize major changes in
changelog.md
. - Increase the
__version__
string insurfa/__init__.py
. If the changes only involve bug fixes, documentation, or behind-the-scenes updates, increase the patch version, otherwise increase the minor version. - Commit these edits to
surfa/__init__.py
andchangelog.md
. - Tag the commit with the appropriate version
git tag vX.X.X
. - Move the latest release tag as well
git tag -f latest
. - Push upstream with
git push && git push --tags --force
To push a formal release to pypi (so that it is pip-installable), first make sure that you have maintainer privileges for the pypi surfa project. If not, ask Andrew.
- Before building the release distribution. Make sure there are no residual or uncommitted changes in your current checkout of the source tree that might be accidentally included. If you want to be extra safe, you could clone the tree in a separate temporary folder.
- From the top-level of the tree, remove a few build-related folders if they already exist:
rm -rf dist surfa.egg-info
. - Generate a source-only (this is important) distribution by running
python setup.py sdist
. - Upload to pypi using
twine upload dist/*
and provide your credentials. If you don't have twine, it can be pip-installed. - That's it! Somtimes it takes a few minutes for the package to be accessible via pip. You'll want to test to make sure the install process goes ok, especially if changes are made to the setup scripts or cython code.
To update the surfa documentation, run the following commands while ssh'd to fsurfer@surfer
. This should be scripted at some point so that documentation can update daily.
# setup
export PATH=$HOME/.local/bin:/space/freesurfer/python/linux/bin:$PATH
export PYTHONPATH=$HOME/surfa.doc/surfa
cd $HOME/surfa.doc
# clone surfa and checkout the just-released stable tag
git clone https://github.com/freesurfer/surfa.git
cd surfa
git checkout vX.X.X
python setup.py build_ext --inplace
cd docs
# build the html
make
# sync the new html (DO NOT run this if the above command failed!)
rsync -aZP --delete build/html/* /var/www/html/docs/surfa/
# cleanup
cd -
rm -rf surfa