Developer Notes¶
If you would like to contribute, please read CONTRIBUTING.md.
Development environment¶
If you break your development environment, you can discard it
by running git clean -dfX and repeating the instructions below.
A local installation for testing and development can be installed using the following commands:
git clone git@github.com:reproducible-reporting/stepup-core.git
cd stepup-core
pre-commit install
python -m venv venv
Put the following lines in .envrc:
source venv/bin/activate
export XDG_CACHE_HOME="${VIRTUAL_ENV}/cache"
export STEPUP_DEBUG="1"
export STEPUP_SYNC_RPC_TIMEOUT="30"
Finally, run the following commands:
Tests¶
We use pytest, so you can run the tests as follows:
Documentation¶
The documentation is created using MkDocs. mike is used to manage documentation of different versions
Edit the documentation Markdown files with a live preview by running:
(Keep this running.) Then open the live preview in your browser at http://127.0.0.1:8000/ and edit Markdown files in your IDE.
Please, use Semantic Line Breaks because it facilitates reviewing documentation changes.
Tutorial Example Outputs¶
If you wish to regenerate the output of the examples, run stepup in the docs directory:
(Keep this running.) Then open the live preview in your browser: http://127.0.0.1:8000/ and edit Markdown files in your IDE.
Please, use Semantic Line Breaks because it results in cleaner file diffs when editing documentation. Note that some scripts use Graphviz to generate diagrams, so you must have it installed on your system.
How to Make a Release¶
- Mark the release in
docs/changelog.md. Do not forget to extend the links at the bottom of the file. - Make a new commit and tag it with
vX.Y.Z. - Trigger the PyPI GitHub Action:
git push origin main --tags.
Profiling¶
StepUp has built-in support for profiling the director process with
the Linux perf profiler and the Yappi profiler.
These instructions assume you are running on Linux and have the perf userspace tool and/or Yappi installed.
-
To profile with
perfon Linux, set theSTEPUP_PERFenvironment variable to a frequency in Hz, or pass the frequency with the--perfcommand-line option.perf-based profiling requires a Linux system with theperftool available, sufficient kernel permissions (for example, appropriateperf_event_paranoidsettings orCAP_PERFMONcapabilities), and a CPython build that supportsperftrampolines as described in the Pythonperfprofiling documentation. Support forperfwas added in CPython 3.12.Enabling
perfwill result in a file.stepup/perf.datacontaining the profiling data. Useperf scriptto convert this file to a human-readable format:The resulting
perf.txtfile can be analyzed with tools like Speedscope. -
To profile with Yappi, set the
STEPUP_YAPPIenvironment variable to1oryes, or pass--yappion the command line. This will result in a file.stepup/director.profcontaining the profiling data. This file can be analyzed with tools like SnakeViz: