Maintainer guides - Telecominfraproject/oopt-gnpy GitHub Wiki

Information for GNPy maintainers

Development tips & tricks

Linters

The coding style we're using is checked and semi-enforced by a linter CI job. In order to reproduce that locally, use flake8. In case it keeps warning about 80-chars per line, make it load its options from tox.ini, i.e., flake8 --config tox.ini (but that should be the default today).

However, we still have plenty of warnings in the code base, so it makes sense to only perform a linter check on the changed content. This filtering is not foolproof because sometimes a change of line A results in a warning on line B (think of unused imports), but it's a useful tool. It works roughly like this:

# check the uncommited, unstaged changes
git diff | flake8 --diff

# check stuff against upstream's master branch
git diff origin/master..HEAD | flake8 --diff

Hosted services

When @jktjkt gets run over by a bus, the show should go on.

Zuul CI

We're using Zuul managed by and hosted at Vexxhost. Support is done via tickets, currently only @jktjkt has access. This is our main target platform for development because it's working well with Gerrit. That way, we get per-patch review, and it's much less painful than dealing with GitHub PRs.

GitHub checks for extra CI

In order to show a shiny green check mark on commits, and to support the related fanciness, we're also using GitHub Actions for running some checks on each push and on each PR (for those cases when someone sends a PR). This is also used for automating releases -- just push a signed tag which begins with the v prefix, and PyPI and Docker gets updated with the right thing.

PyPI

Access: Jan's private account, Esther, and a Jan's dedicated account managed by @jktjkt and tied to his @telecominfraproject.com e-mail. That one has issued service tokens which can upload releases automatically. Upon a push of the release tag, a new release of the gnpy package gets uploaded automatically.

Docker Hub

GitHub Actions also build and upload a Docker image:

  • one per each push, tagged as master and as a specific commit ID, such as v2.3.1-27-g88e2a0c7
  • one for each release, such as v2.3.1

The uploads go to the telecominfraproject organization, but the service token was issued via the jktjkt account.