CI#

This page gather the steps to set up the Continuous Integration by reusing the files related to another similar project. The relevant files are:

  • pyproject.toml: Project settings

  • .github/workflows/*.yml: GitHub actions

  • .readthedocs.yml: Readthedoc workflow

Build#

If the project is build using poetry, ensure this is reflected in .github/workflows/build.yml.

PyPI#

  1. In .github/workflows/publish_on_pypi.yml:

  • update the PyPI URL of the project

  • enable/remove in the with: statement:

    • verbose: true

    • skip-existing: true

  1. Configure the project Test PyPI.

  • Connect to your Test PyPI account.

  • Add a new pending publisher. This allows GitHub to push stuff to Test PyPI without configuring any token.

    • Name of the PyPI project: name of the PyPI package (defined in poetry.toml, e.g., fuzzy-set-nokia)

    • Owner: 2nd part in the GitHub URL repository (e.g., Nokia-Bell-Labs in Nokia-Bell-Labs/fuzzy-set).

    • Repository name: 3rd part in the GitHub URL repository (e.g., fuzzy-set in Nokia-Bell-Labs/fuzzy-set).

    • Workflow name: Filename of publishing workflow (e.g., publish_on_pypi.yml in Nokia-Bell-Labs/fuzzy-set).

    • Environment name: testpypi (reported in GitHub environments)

  1. Repeat the previous steps for PyPI.

  2. Push an update using git push and a tag using git push --tags. As stated in .github/workflows/publish_on_pypi.yml this respectively updates Test PyPI and PyPI

  3. Update the related badge in README.md. Test the link and image URLs of the badge are correct with a web browser.

ReadTheDoc#

  1. If the project is build using poetry, ensure this is reflected in .readthedocs.yml. In particular, ensure that the dependencies needed to build the documentation will be deployed.

  2. Connect to your Readthedoc account.

  3. Create a new project. This name is used by your dashboard. You should choose the name of the PyPI package but it’s not mandatory. If the repository is not found automatically, configure it manually:

  • Name: this name is used to craft the URL that will serve the documentation.

  • Repository URL: the GitHub URL (e.g., Nokia-Bell-Labs/fuzzy-set).

  • Default branch: usually main. Old repositories might use master.

  • Language English

  1. If readthedoc displays Unable to attach webhook to this project Could not add webhook for “fuzzy-set”. Make sure `you have the correct GitHub permissions <https://docs.readthedocs.io/page/webhooks.html>`_.: