Developer notes

Notes about code

Use the decorator eduvpn.utils.run_in_background_thread to schedule long running action in the background to avoid blocking the main thread.

Never call GTK functions directly from a background thread, use eduvpn.utils.run_in_main_gtk_thread to decorate functions that must run on the main thread (eg. UI updates).

eduvpn.actions are the entrypoints to the application and are triggered from the main menu or a VPN status change.

eduvpn.remote contains all remote requests.

Flow schema

The application flow

Running the tests

To run the automated tests, use the following command from the root of the project.

$ pytest

To include integration tests against an actual server, you’ll need to provide the address and login credentials in an environment variable.

$ TEST_SERVER=username:password@example.com pytest

How to make a release

Prepare the code

  • Determine version number (for example 1.0.2)
  • Compose a list of changes (check issue tracker)
  • Make sure the test suite runs with python3
  • Set version number in setup.py, and eduvpn.spec
  • add changes to CHANGES.md
  • Commit
  • Press release button on github. List all changes here also
  • Check if github actions builds.
  • The release will trigger a build on readthedocs, but the active version still needs to be set manually here: https://readthedocs.org/projects/python-eduvpn-client/versions/

Upload to pypi

do a manual wheel upload using twine:

$ rm dist/*
$ python setup.py bdist_wheel sdist
$ twine upload dist/*

There is also a make shortcut:

$ make twine-upload

Build on copr for RPMs

Build packages to the COPR repository:

You can also trigger this build from the cli. First fetch your token from the COPR api page and dump this in ~/.config/copr. Next, you install the copr cli and trigger the build with:

$ venv/bin/pip install copr-cli
$ copr-cli buildscm \
   --clone-url https://github.com/edupvn/python-eduvpn-client \
   --commit <version> \
   --spec eduvpn.spec
   @eduvpn/eduvpn-client

where <version> is the tag/version of the release.

There is also a make shortcut:

$ make copr-upload

Build Debian packages