|
| 1 | +# Obelisk-py Contribution and Development Guide |
| 2 | + |
| 3 | +## Technical setup |
| 4 | + |
| 5 | +This project uses [uv](https://docs.astral.sh/uv/) to manage dependencies, |
| 6 | +Python versions and deployments. |
| 7 | +As a result, all metadata and dependencies are defined in the `pyproject.toml` file. |
| 8 | +`uv` also automatically installs the dev dependencies, so no special handling is needed. |
| 9 | + |
| 10 | +## Docs |
| 11 | + |
| 12 | +Docs are in RST format under the `docs` folder. |
| 13 | +Autodoc and autosummary are used to turn docblocks into documentation. |
| 14 | +The online variant follows the main branch. |
| 15 | + |
| 16 | +The build command boils down to the following: |
| 17 | +```sh |
| 18 | +uv run sphinx-build -M html docs/source/ docs/build/ |
| 19 | +``` |
| 20 | + |
| 21 | +We recommend running `python -m http.server` in the docs output folder to easily view the resulting docs during development. |
| 22 | + |
| 23 | +## Checks and tests |
| 24 | + |
| 25 | +We ship a ruff linting and format config in the pyproject, |
| 26 | +as well as a mypy typing setup. |
| 27 | +All three of these are ran in CI and, if enabled, in a pre-commit hook. |
| 28 | +Be careful to not accidentally break our Python version tolerance. |
| 29 | +The hooks can be enabled on UNIX-like systems by setting `git config core.hooksPath hooks/` in the root of this repository. |
| 30 | + |
| 31 | +You may run the full checks as follows: |
| 32 | +```sh |
| 33 | +uv run ruff format --check |
| 34 | +uv run ruff check |
| 35 | +uv run mypy |
| 36 | +``` |
| 37 | + |
| 38 | +We expect new code to contain as much docblocks as possible and type annotations. |
| 39 | +User-facing API _must_ have type annotations. |
| 40 | + |
| 41 | +Additionally, the `src/tests` folder contains basic testing, |
| 42 | +which can be ran easily ran using `uv run pytest`. |
| 43 | + |
| 44 | +It is recommended to at least add basic "can I initialize" tests for new code. |
| 45 | + |
| 46 | +## Workflows |
| 47 | + |
| 48 | +Our GitHub Actions setup consists of three workflows. |
| 49 | +The CI workflow runs on any PR or push to main, |
| 50 | +and runs the above mentioned checks and tests. |
| 51 | + |
| 52 | +Format, lint and type checking is ran on Linux, for several supported Python versions. |
| 53 | +The test suite is ran on MacOS, Linux and Windows, matrixed for the same set of Python versions. |
| 54 | +No code gets merged that breaks this lint. |
| 55 | + |
| 56 | +The sphinx workflow builds docs from main and deploys to GitHub Pages. |
| 57 | +Pypi publishing is handled using PyPi Trusted Publishing using the pypi workflow on tag creation. |
| 58 | + |
| 59 | +## Governance and conduct |
| 60 | + |
| 61 | +This project is intended for and maintained by researchers of [PreDiCT](https://predict.idlab.ugent.be/). |
| 62 | +Community contributions and bug reports are welcome, but subject to review and prioritisation by PreDiCT. |
| 63 | + |
| 64 | +Obelisk-py is not directly maintained or supported by the Obelisk team. |
| 65 | + |
| 66 | +Please behave in the official channels as you would in a professional research setting. |
0 commit comments