Migration to Package Helper 2

Package Helper is no longer maintained. It is replaced by Package Helper 2: in order to make your workflow even easier, Package Helper 2 uses GitHub actions instead of additional services, such as Travis-CI and ReadTheDocs. For new projects, we recommend using Package Helper 2. For your existing packages that used Package Helper, here is a migration guide to Package Helper 2.

  1. Directory docs → file conf.py. In the list extensions, add 'sphinx.ext.githubpages'.

  2. File requirements.txt: if this file does not exist, create it at the root of your project.

    1. Ensure that the following lines are in the file:

      sphinx>=1.4
      sphinx-rtd-theme
      
    2. If you want to use jupyter notebooks in your documentation, ensure that you have also:

      nbsphinx
      ipykernel
      
  3. File README.rst:

    1. Replace the badges with the following lines:

      .. image:: https://img.shields.io/pypi/v/YOUR_PACKAGE_SLUG.svg
              :target: https://pypi.python.org/pypi/YOUR_PACKAGE_SLUG
              :alt: PyPI Status
      
      .. image:: https://github.com/YOUR_USERNAME/YOUR_PACKAGE_SLUG/workflows/build/badge.svg?branch=master
              :target: https://github.com/YOUR_USERNAME/YOUR_PACKAGE_SLUG/actions?query=workflow%3Abuild
              :alt: Build Status
      
      .. image:: https://github.com/YOUR_USERNAME/YOUR_PACKAGE_SLUG/workflows/docs/badge.svg?branch=master
              :target: https://github.com/YOUR_USERNAME/YOUR_PACKAGE_SLUG/actions?query=workflow%3Adocs
              :alt: Documentation Status
      
      .. image:: https://codecov.io/gh/YOUR_USERNAME/YOUR_PACKAGE_SLUG/branch/master/graphs/badge.svg
              :target: https://codecov.io/gh/YOUR_USERNAME/YOUR_PACKAGE_SLUG/branch/master/graphs
              :alt: Code Coverage
      
    2. In these lines, replace YOUR_PACKAGE_SLUG with your package slug and YOUR_USERNAME with your GitHub username.

    3. If you want, replace the ReadTheDocs url with: https://YOUR_USERNAME.github.io/YOUR_PACKAGE_SLUG/. We will keep the two documentations alive anyway, so do as you please.

  4. Download the workflows directory. Uncompress it into the .github directory of your project. For example, you should have a file .github/workflows/build.yml.

  5. Commit/push.

  6. On the GitHub page of your package:

    1. Go to “Actions”. Check that your actions pass properly.
    2. Tell GitHub Pages that the documentation files are in the “gh-pages” branch of your project:
      1. Settings → Options (= main page) → GitHub Pages → Source.
      2. Select “gh-pages”.
      3. Save.
    3. Register your PyPI credentials as “secrets”, so that GitHub can automatically publish your package on PyPI for you:
      1. Settings → Secrets.
      2. Select “New repository secret”. Name: PYPI_USERNAME. Value: your PyPI username.
      3. Select “New repository secret”. Name: PYPI_PASSWORD. Value: your PyPI password.
  7. Leave your ReadTheDocs “hook” alive: this way, users can still access the documentation of your package at the url they know.

  8. On Travis-CI website: remove the “hook” to your project. Since you won’t use Travis-CI anymore, no need to waste power consumption.

    1. Go to: https://travis-ci.org/account/repositories .
    2. Put your package on “off”.