For bug reports and suggestions, please open an issue.
Note Onyo requires Python 3.11 or higher.
Navigate to https://github.com/psyinfra/onyo/ and fork the repository.
git clone git@github.com:<your_username>/onyo.git
cd onyo
python3 -m venv ~/.venvs/onyo
source ~/.venvs/onyo/bin/activate
Debian/Ubuntu:
apt-get install git tig python3-pip
macOS (Homebrew:
brew install git tig
pip3 install -e ".[tests, docs]"
Tests are run from the top-level of the repository.
pytest -vv
Generating code coverage reports requires some small gymnastics due to Onyo's tests running in individual working directories.
REPO_ROOT=$PWD pytest -vv --cov
Linting uses both ruff and Pyre.
ruff check
pyre check
Benchmarks use pytest-benchmark.
pytest -p no:randomly -p no:cov --benchmark-autosave --benchmark-time-unit=s --benchmark-max-time=5 --benchmark-min-rounds=5 --benchmark-sort=name --benchmark-group-by=func --benchmark-columns=min,max,mean,stddev,median,rounds -vv onyo/tests/benchmark.py
To compare to previous runs:
pytest-benchmark compare .benchmarks/[...] [...]
make -C docs clean html
Navigate to <file:///<repo_dir>/docs/build/html/index.html>
Onyo follows a set of development and coding conventions throughout its code base. For linting and type checking, Onyo uses ruff and Pyre. The following sections describe conventions followed in this project, additionally to the PEP 8 Style Guide.
- Classes, functions and properties (including tests) have a docstring following the Numpy standard.
- Functions have type hinting for parameters and return types.
- Code style follows PEP 8.
- define the public Python API behavior
- comprehensively test combinations of parameters
- use only the Python API (no usage of
subprocess.run(["onyo", ...])
)
- define the CLI behavior
- comprehensively test combinations of arguments/flags
- use only CLI commands (e.g. call
subprocess.run(["onyo", ...])
) and are independent entirely of the Python API