docs(Python): more documentation

This commit is contained in:
Dr Yann Golanski 2025-08-24 19:41:28 +01:00
parent 1ce039a6af
commit d15a8461c5
No known key found for this signature in database
GPG Key ID: F11623388E71CCCF
5 changed files with 24 additions and 2 deletions

View File

@ -1,5 +1,8 @@
# Checks documentaton with pydocstyle and then builds it.
# Checks documentaton with pydocstyle and then builds it.
#
# Note that it does not publish it, just checks you can build it.
#
# See test.yaml for more information.
when:
- event: pull_request

View File

@ -1,4 +1,6 @@
# Simple linting with the latest version of ruff.
#
# See test.yaml for more information.
when:
- event: pull_request

View File

@ -1,5 +1,6 @@
# Check type hints wiht mypy.
# Note that this uses uv to generate a requirements.txt file.
#
# See test.yaml for more information.
when:
- event: pull_request
@ -11,8 +12,10 @@ steps:
image: python:latest
commands:
- pip install uv
# uv normally installs in a venv, but I could not work out how to activate it. Therefore, I used this work around.
- uv export --format requirements.txt > requirements.txt
- uv pip install --system -r requirements.txt
# This needs all the dependencies since they include type hints.
- mypy src
depends_on:
- security

View File

@ -1,4 +1,6 @@
# Runs bandit to make sure you don't have security issues.
#
# See test.yaml for more information.
when:
- event: pull_request

View File

@ -1,7 +1,16 @@
# Runs all the unit test with coverage and generates a report.
#
# Note that
#
# 1. This runs only after security, lint, mypy and docs checks have passed.
# a. Security runs bandit.
# b. Lint runs ruff.
# c. Mypy runs mypy, for typ4e hints.
# d. Docs runs pydocstyle and mkdocs — with the material theme since it's the one I use.
# 2. This uses uv to generate a requirements.txt file.
# 3. I run from Python 3.10 to 3.13.
# 4. 3.14 is still in development, but you could add it, and make sure the test failure is none-blocking.
# 5. I have no idea how to get the coverage report so Woodpeck/Codeberg can display it.
when:
- event: pull_request
@ -13,8 +22,10 @@ steps:
image: python:${TAG}
commands:
- pip install uv
# uv normally installs in the venv, but I could not work out how to activate it. Therefore, I used this work around.
- uv export --format requirements.txt > requirements.txt
- uv pip install --system -r requirements.txt
# Running coverage with pytest and generates a report.
- coverage run --concurrency=thread -m pytest --doctest-modules --slow
- coverage combine
- coverage report -m
@ -28,6 +39,7 @@ matrix:
- 3.13
depends_on:
# See files of the same name here.
- security
- lint
- mypy