Contributing to rtflite¶
Developer workflow¶
Setup¶
First off, install uv. rtflite uses uv to manage the Python package development environment.
Branching¶
Clone the repository (if you have no direct access, replace the address with your forked repository address):
Create a dedicated branch:
Dependencies¶
Restore the environment using
uv sync.
This will restore the exact versions of Python and dependency packages
under the project's .venv/
directory:
Development¶
Open the project in VS Code:
Make changes to the codebase.
We use pytest for unit testing. To run tests and get an HTML preview of code coverage, open the VS Code terminal:
If your terminal did not activate the virtual environment for some reason (with symptoms like not finding pytest commands), activate it manually:
Documentation¶
If you made changes to the .md
files in the root directory or the
.qmd
vignettes under docs/articles/
, make sure to synchronize them
for the mkdocs website:
To preview the mkdocs website:
rtflite organizes vignettes using Quarto. To install Quarto on macOS:
Currently, Quarto is only used to render .qmd
sources into .md
files for the mkdocs site and .py
files for examples/
.
It does not execute code. Outputs such as text, tables, images, and PDFs
must be manually included in the .qmd
files or put in the mkdocs site
(docs/articles/
).
Formatting¶
Use isort and ruff to sort imports and format Python code:
Pull request¶
Add, commit, and push to remote, then send a pull request:
Maintainer workflow¶
Updates¶
Update local uv version:
Update uv.lock
file regularly:
Python version¶
Pin a newer Python version in .python-version
when appropriate:
The latest Python release versions are often promptly supported by uv.
Publishing¶
Publish on PyPI (maintainer token required):