PROTEUS targets Python 3.11 or newer.
Clone the repository into the proteus
directory:
git clone https://github.com/FormingWorlds/PROTEUS proteus
Install using virtualenv
:
cd proteus
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install -e .[develop]
Alternatively, install using Conda:
cd proteus
conda create -n proteus python=3.12
conda activate proteus
pip install -e .[develop]
Linting is a term for static code analysis to flag programming errors,
bugs, stylistic errors and suspicious constructs.
PROTEUS uses ruff
for linting.
The linting rules are defined in pyproject.toml
.
This check are run automatically via a Github Action: codestyle.
You can ruff
on locally using one of these commands:
ruff check start_proteus.py # single file
ruff check src/proteus # directory
ruff check . # everything
If you prepend --fix
, it can also fix some issues for you:
ruff check . --fix
You can also use pre-commit to automatically run ruff
on every commit, e.g.:
pre-commit install
PROTEUS uses pytest to run the tests.
The tests are run automatically via a Github Action: tests.
You can run the tests for yourself using:
pytest
To check coverage:
coverage run -m pytest
coverage report # to output to terminal
coverage html # to generate html report
The documentation is written in markdown, and uses mkdocs to generate the pages.
To build the documentation for yourself:
pip install -e '.[docs]'
mkdocs serve
You can find the documentation source in the docs directory.
If you are adding new pages, make sure to update the listing in the mkdocs.yml
under the nav
entry.
The documentation is hosted on readthedocs.
The versioning scheme we use is CalVer.
- Update requirements files:
python tools/generate_requirements_txt.py
pip-compile -o requirements_full.txt pyproject.toml
- Bump the version (
release
/patch
) as needed
bump-my-version bump release
# 24.08.12
-
Commit and push your changes.
-
Make a new release. Make sure to set the tag to the specified version, e.g.
24.08.12
. -
The upload to pypi is triggered when a release is published and handled by this workflow.