build: cap floating dependencies, add a ci coverage report and fix the contributing checks

This commit is contained in:
imSp4rky
2026-11-26 13:40:07 -07:00
parent 98717fda43
commit 5575892395
4 changed files with 173 additions and 12 deletions
+35 -3
View File
@@ -1,11 +1,11 @@
# Development
This project is managed using [UV](https://github.com/astral-sh/uv), a fast Python package and project manager.
Install the latest version of UV before continuing. Development currently requires Python 3.9+.
Install the latest version of UV before continuing. Development requires Python 3.11 to 3.14.
## Set up
Starting from Zero? Not sure where to begin? Here's steps on setting up this Python project using UV. Note that
Starting from Zero? Not sure where to begin? Here are the steps to set up this Python project using UV. Note that
UV installation instructions should be followed from the UV Docs: https://docs.astral.sh/uv/getting-started/installation/
1. Clone the Repository:
@@ -38,8 +38,40 @@ UV installation instructions should be followed from the UV Docs: https://docs.a
- JetBrains PyCharm and Visual Studio Code will automatically detect the UV-managed virtual environment
- For more information, see: https://docs.astral.sh/uv/concepts/projects/
4. Install Pre-commit tooling to ensure safe and quality commits:
4. Install the pre-commit hooks, which check each commit:
```shell
uv run pre-commit install
```
## Checks
CI runs these checks on each pull request and on each push to `dev` and `main`. Run them before you open a pull request.
1. Install the test dependencies. `uv sync` alone installs only the `dev` group:
```shell
uv sync --all-groups
```
2. Run the unit tests. The markers skip the tests that need a live server or the network:
```shell
uv run pytest -n auto --dist worksteal -m "not live and not slow"
```
3. Run the linters, the type check and the security lint:
```shell
uv run ruff check .
uv run ruff format --check .
uv run isort --check-only unshackle tests --skip-glob "*/services/*"
uv run mypy unshackle
uv run bandit -q -c pyproject.toml -r unshackle --severity-level medium --confidence-level medium
```
To get a coverage report, run the tests with the coverage option:
```shell
uv run pytest -n auto --dist worksteal -m "not live and not slow" --cov
```