Making a release

A core developer should use the following steps to create a release X.Y.Z of scikit-build on PyPI and Conda.

Prerequisites

Documentation conventions

The commands reported below should be evaluated in the same terminal session.

Commands to evaluate starts with a dollar sign. For example:

$ echo "Hello"
Hello

means that echo "Hello" should be copied and evaluated in the terminal.

Setting up environment

  1. First, register for an account on PyPI.

  2. If not already the case, ask to be added as a Package Index Maintainer.

  3. Create a ~/.pypirc file with your login credentials:

    [distutils]
    index-servers =
      pypi
      pypitest
    
    [pypi]
    username=<your-username>
    password=<your-password>
    
    [pypitest]
    repository=https://test.pypi.org/legacy/
    username=<your-username>
    password=<your-password>
    
where <your-username> and <your-password> correspond to your PyPI account.

PyPI: Step-by-step

  1. Make sure that all CI tests are passing on AppVeyor, Azure Pipelines, CircleCI and Travis CI.
  2. Download the latest sources
$ cd /tmp && \
  git clone git@github.com:scikit-build/scikit-build && \
  cd scikit-build
  1. List all tags sorted by version
$ git fetch --tags && \
  git tag -l | sort -V
  1. Choose the next release version number
$ release=X.Y.Z

Warning

To ensure the packages are uploaded on PyPI, tags must match this regular expression: ^[0-9]+(\.[0-9]+)*(\.post[0-9]+)?$.

  1. In README.rst, update PyPI download count after running this big table query and commit the changes.
$ git add README.rst && \
  git commit -m "README: Update download stats [ci skip]"

Note

To learn more about pypi-stats, see How to get PyPI download statistics.

  1. In CHANGES.rst replace Next Release section header with Scikit-build X.Y.Z and commit the changes.
$ git add CHANGES.rst && \
  git commit -m "Scikit-build ${release}"
  1. Tag the release
$ git tag --sign -m "Scikit-build ${release}" ${release} master

Warning

We recommend using a GPG signing key to sign the tag.

  1. Create the source distribution and wheel
$ python setup.py sdist bdist_wheel
  1. Publish the both release tag and the master branch
$ git push origin ${release} && \
  git push origin master
  1. Upload the distributions on PyPI
twine upload dist/*

Note

To first upload on TestPyPI , do the following:

$ twine upload -r pypitest dist/*
  1. Create a clean testing environment to test the installation
$ pushd $(mktemp -d) && \
  mkvirtualenv scikit-build-${release}-install-test && \
  pip install scikit-build && \
  python -c "import skbuild"

Note

If the mkvirtualenv command is not available, this means you do not have virtualenvwrapper installed, in that case, you could either install it or directly use virtualenv or venv.

To install from TestPyPI, do the following:

$ pip install -i https://test.pypi.org/simple scikit-build
  1. Cleanup
$ popd && \
  deactivate  && \
  rm -rf dist/* && \
  rmvirtualenv scikit-build-${release}-install-test
  1. Add a Next Release section back in CHANGES.rst, commit and push local changes.
$ git add CHANGES.rst && \
  git commit -m "CHANGES.rst: Add \"Next Release\" section [ci skip]" && \
  git push origin master

Conda: Step-by-step

Warning

Publishing on conda requires to have corresponding the corresponding Github release.

After a GitHub release is created in the scikit-build project and after the conda-forge Autoticking Bot creates a pull request on the scikit-build-feedstock , follow these steps to finalize the conda package release:

  1. Review and update scikit-build-feedstock pull request to include Python 3.5 support (see here for an example)
  2. Merge pull-request

In case the bot failed (e.g because of GH rate limitation) and in order to explicitly release a new version on conda-forge, follow the steps below:

  1. Choose the next release version number (that matches with the PyPI version last published)
$ release=X.Y.Z
  1. Fork scikit-build-feedstock
First step is to fork scikit-build-feedstock repository. This is the recommended best practice by conda.
  1. Clone forked feedstock

    Fill the YOURGITHUBUSER part.

    $ cd /tmp && git clone https://github.com/YOURGITHUBUSER/scikit-build-feedstock.git
    
  2. Download corresponding source for the release version

$ cd /tmp && \
  wget https://github.com/NeurodataWithoutBorders/scikit-build/releases/download/$release/scikit-build-$release.tar.gz
  1. Create a new branch

    $ cd scikit-build-feedstock && \
      git checkout -b $release
    
  2. Modify meta.yaml

    Update the version string and sha256.

    We have to modify the sha and the version string in the meta.yaml file.

    For linux flavors:

    $ sed -i "2s/.*/{% set version = \"$release\" %}/" recipe/meta.yaml
    $ sha=$(openssl sha256 /tmp/scikit-build-$release.tar.gz | awk '{print $2}')
    $ sed -i "3s/.*/{$ set sha256 = \"$sha\" %}/" recipe/meta.yaml
    

    For macOS:

    $ sed -i -- "2s/.*/{% set version = \"$release\" %}/" recipe/meta.yaml
    $ sha=$(openssl sha256 /tmp/scikit-build-$release.tar.gz | awk '{print $2}')
    $ sed -i -- "3s/.*/{$ set sha256 = \"$sha\" %}/" recipe/meta.yaml
    
  3. Push the changes

    $ git push origin $release
    
  4. Create a Pull Request

    Create a pull request against the main repository. If the tests are passed a new release will be published on Anaconda cloud.