Developer’s Guide

Testing

Run pytest to execute the test suite.

The test suite creates many temporary directories. There is usually a limit on the number of open file descriptors on Unix systems, which causes some tests and the end of the test suite to fail. If that happens, increase the limit with the following command.

ulimit -n 4096

How to release

The following list covers all steps of a release cycle.

  • Start a new release cycle by opening a milestone. Assign all relevant issues and merge requests to this milestone.

  • Every change is pushed to the repository’s main branch and will make it into the next release.

  • Once all additions to a release are merged, prepare docs/source/changes.md listing all changes that made it into the release.

  • Update the version numbers in the animations if you create a new major or minor release.

  • Go to the main branch and set a new tag with git tag vx.x.x -m "vx.x.x". Then, push the tag to the repository.

  • Creating a tag will trigger a pipeline that builds the package and uploads it to PyPI, consequently triggering a new release on conda-forge.

    The pipeline also creates a GitHub release under releases. Fill out the release notes.

Profiling the application

cProfile

To profile pytask, you can follow this video (it also features explanations for git bisect, caching, and profiling tools). We use cProfile with

$ python -m cProfile -o log.pstats -m pytask directory/with/tasks

The profile can be visualized with

$ pip install yelp-gprof2dot
$ gprof2dot log.pstats | dot -T svg -o out.svg

importtime

To measure how long it takes to import pytask, use

$ python -X importtime -c "import pytask"