Skip to content

Release Procedures

Nadia Dencheva edited this page Dec 13, 2020 · 23 revisions

Release Procedures

Releases are made on release branches. When done the branch is merged with the stable branch via a Pull Request (PR).

The example below creates a hypothetical release version 2.0.0.

For this setup we assume the release is made in a local directory, other than your romancal working directory, caalled releases. This workflow assumes working directly with the spacetelescope repository.

Clone the repository on spacetelescope.

 cd releases
 git clone [email protected]:spacetelescope/romancal.git`

Prepare the release branch

  1. Make last changes to the main branch. Edit CHANGES.rst to set the release date. If necessary make other code changes (there shouldn't really be any changes at this point). If necessary update README.rst.

  2. Make sure you are on the main branch. Make a branch for the release. Name the branch 2.0.0x. Always use a letter at the end of the branch name so that the version number can be used later as a tag.

git status # should show you are on main.
git branch 2.0.0x
git checkout 2.0.0x
  1. Push the 2.0.0x branch to spacetelescope. Note, that origin below refers to the spacetelescope repository.
git push origin 2.0.0x
  1. Tag the release branch with the new release and push the tag to the spacetelescope repository. Make sure tests pass on the new branch.
git checkout 2.0.0x
git tag -a "2.0.0" -m "tagging release 2.0.0"
git push origin 2.0.0
  1. Make a PR against the stable branch and after tests pass merge the PR into stable.

Note, make sure GA runs the tests with the public releases of astropy and asdf.

Prepare main for further development

Checkout main and change Changes.rst to open a new section for the next release. Push the changes to spacetelescope. Tag the main branch for further development. The suggested tag is a minimal increment of the latest release version tag, followed by a. The tag name should be chosen in such a way that conda would resolve it as the latest tag.

git checkout main
git tag -a "2.1.0a" -m "tagging for further development"
git push origin 2.1.0a

Publish to test.pypi.org

Before proceeding, you will need to pip install twine.

  1. Checkout the release tag, clean the directory, and make sure umask and permissions are set correctly:

    $ git checkout 2.0.0
    $ git clean -xdf
    
  2. Upload the package to PyPi's test server (you need an account and be added as maintainer):

    $ twine upload --repository testpypi dist/*
    
  3. Check that it looks good on the test server. Make sure it installs without errors in a new virtual env:

    $ pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple romancal[test]
    
  4. Run the tests on the installed package. Change to a directory that does not contain the romancal source and confirm that tests pass on the installed package.:

    $ pushd /
    $ pytest romancal
    $ popd
    
  5. If the package looks good on test.pypi.org and installs OK and the tests pass, then proceed.

Make the release official on Github and Pypi

  1. Checkout the release tag.
git checkout 2.0.0
  1. Clean the working directory and build the distribution package.
git clean -dfx
python setup.py build sdist
  1. Test the distribution by going into the dist directory , unpacking and running the tests. Make sure the tests are run with the stable versions (publicly released versions) of astropy and asdf. If the tests pass with stable versions, proceed with the release.

  2. Clean after the tests and build the distribution again. Upload the package to PYPI.

git clean -dfx
python setup.py build sdist
twine upload dist/romancal-2.0.0.tar.gz
Clone this wiki locally