Skip to content

Creating a release

Jeffrey Gill edited this page Jan 17, 2021 · 44 revisions

Releasing to PyPI

  1. Gather closed issues and pull requests related to the release into a GitHub milestone:

    https://github.com/jpgill86/neurotic/milestones

  2. Create a branch called "release-X.X.X" using the real release number.

  3. In the docs, add a change log entry referencing each notable PR and issue (remember to add a link from releasenotes.rst!)

  4. In setup.py, set IS_RELEASED = True and set the new version number.

  5. Commit these changes to the branch with the message "Prepare release X.X.X", push the branch to GitHub, and open a pull request.

  6. Wait for all tests to pass:

    https://github.com/jpgill86/neurotic/actions?query=workflow%3Atests

  7. If tests are OK, do not merge yet, since you should first verify PyPI is happy with your changes. On your local machine, delete any old build directories:

    cd neurotic
    rm -rf build dist neurotic.egg-info
    
  8. Build for distribution:

    python setup.py sdist bdist_wheel
    
  9. Upload the build artifacts to PyPI's test server:

    twine upload --repository-url https://test.pypi.org/legacy/ dist/*
    
  10. Verify the test release looks OK:

    https://test.pypi.org/project/neurotic/

  11. If PyPI is OK, merge the pull request with commit name "Release X.X.X".

  12. Verify that the new release notes built correctly:

    https://neurotic.readthedocs.io/en/latest/releasenotes.html

  13. If the docs are OK, tag the PR merge commit with the release number and push the tag to GitHub.

  14. Mark the new release as an active version on Read the Docs so that an archive of the docs for the current version is available in the future even after later releases (this may be done automatically):

    https://readthedocs.org/projects/neurotic/versions/

  15. If all is well, rebuild the package (to get post-merge git_revision in version.py) and upload to the official PyPI server (THIS CANNOT BE UNDONE OR OVERWRITTEN):

    rm -rf build dist neurotic.egg-info
    python setup.py sdist bdist_wheel
    twine upload dist/*
    
  16. Verify the official release looks OK:

    https://pypi.org/project/neurotic/

  17. In setup.py, set IS_RELEASED = False and increment the version number to the next patch release.

  18. Commit these changes directly to master with the message "After release" and push to GitHub.

  19. Create a GitHub release from the pushed tag containing the release notes:

    https://github.com/jpgill86/neurotic/tags

  20. Close the milestone and create a new one for the next patch release:

    https://github.com/jpgill86/neurotic/milestones

Building for conda-forge

  1. In your fork of conda-forge/neurotic-feedstock, create a branch called "build-X.X.X" using the real release number.

  2. Edit the feedstock's meta.yaml file by:

    1. updating the version number
    2. updating the sha256 (which can be obtained for the tar.gz file here)
    3. resetting the build number to 0
  3. If any other changes to the build recipe are required, such as updating the minimum versions of dependencies, make those now.

  4. Commit these changes to the branch with the message "Build for release X.X.X", push the branch to GitHub, and open a pull request.

  5. Post @conda-forge-admin, please rerender in the pull request and wait for the bot to update the recipe.

  6. Make sure the checklist in the pull request's initial post is complete.

  7. Wait for all tests to pass:

    https://dev.azure.com/conda-forge/feedstock-builds/_build?definitionId=8417&_a=summary

  8. If tests are OK, merge the pull request.

  9. The new build should appear on Anaconda Cloud fairly quickly:

    https://anaconda.org/conda-forge/neurotic/files

    but the index of the CDN that distributes the build may take a little longer to sync with it. You can check to see if the new release is listed in the index with this command (with the actual version number):

    curl https://conda-static.anaconda.org/conda-forge/rss.xml -s 2>&1 | grep neurotic-X.X.X

    The last time the index was updated can be checked using this command:

    curl https://conda-static.anaconda.org/conda-forge/rss.xml -s 2>&1 | head -10 | tail -1

    If this takes a very long time (many hours), you can post on Gitter to see if anyone is available to force the CDN's index to update:

    https://gitter.im/conda-forge/conda-forge.github.io

Building installers

  1. Update the jpgill86/neurotic-constructor recipe with the new version number, and any other required changes.

  2. Update all three GitHub Actions workflows with the new version number.

  3. Commit the changes to master and push to GitHub.

  4. Wait for the installers to be built automatically by GitHub Actions:

    https://github.com/jpgill86/neurotic-constructor/actions

  5. Download all three installers (build artifacts).

  6. Add the date to each installer file name (e.g., neurotic-1.2.0-2019.12.06-Windows-x86_64.exe).

  7. Upload the installers to the new GitHub release page:

    https://github.com/jpgill86/neurotic/releases

Clone this wiki locally