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#
In
.github/workflows/publish_on_pypi.yml:
update the PyPI URL of the project
enable/remove in the
with:statement:verbose: trueskip-existing: true
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-Labsin Nokia-Bell-Labs/fuzzy-set).Repository name: 3rd part in the GitHub URL repository (e.g.,
fuzzy-setin Nokia-Bell-Labs/fuzzy-set).Workflow name: Filename of publishing workflow (e.g.,
publish_on_pypi.ymlin Nokia-Bell-Labs/fuzzy-set).Environment name:
testpypi(reported in GitHub environments)
Repeat the previous steps for PyPI.
Push an update using
git pushand a tag usinggit push --tags. As stated in.github/workflows/publish_on_pypi.ymlthis respectively updates Test PyPI and PyPIUpdate the related badge in
README.md. Test the link and image URLs of the badge are correct with a web browser.
ReadTheDoc#
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.Connect to your Readthedoc account.
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 usemaster.Language English
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>`_.:
If this is a repository attached to an organization, browse your Github profile > Application > Authorized OAuth Apps > Read the Docs Community (readthedocs.org) > Organization access. Select the appropriate organization and request an access if not yet granted.
In the Integration settings of your Readthedoc project, try to resync the hook.
If it fails, try configure the webhook manually