mirror of
https://codeberg.org/Codeberg-CI/examples.git
synced 2025-09-12 05:15:00 -04:00
docs(Python): more documentation
This commit is contained in:
parent
1ce039a6af
commit
d15a8461c5
@ -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.
|
# Note that it does not publish it, just checks you can build it.
|
||||||
|
#
|
||||||
|
# See test.yaml for more information.
|
||||||
|
|
||||||
when:
|
when:
|
||||||
- event: pull_request
|
- event: pull_request
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
# Simple linting with the latest version of ruff.
|
# Simple linting with the latest version of ruff.
|
||||||
|
#
|
||||||
|
# See test.yaml for more information.
|
||||||
|
|
||||||
when:
|
when:
|
||||||
- event: pull_request
|
- event: pull_request
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
# Check type hints wiht mypy.
|
# Check type hints wiht mypy.
|
||||||
# Note that this uses uv to generate a requirements.txt file.
|
#
|
||||||
|
# See test.yaml for more information.
|
||||||
|
|
||||||
when:
|
when:
|
||||||
- event: pull_request
|
- event: pull_request
|
||||||
@ -11,8 +12,10 @@ steps:
|
|||||||
image: python:latest
|
image: python:latest
|
||||||
commands:
|
commands:
|
||||||
- pip install uv
|
- 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 export --format requirements.txt > requirements.txt
|
||||||
- uv pip install --system -r requirements.txt
|
- uv pip install --system -r requirements.txt
|
||||||
|
# This needs all the dependencies since they include type hints.
|
||||||
- mypy src
|
- mypy src
|
||||||
depends_on:
|
depends_on:
|
||||||
- security
|
- security
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
# Runs bandit to make sure you don't have security issues.
|
# Runs bandit to make sure you don't have security issues.
|
||||||
|
#
|
||||||
|
# See test.yaml for more information.
|
||||||
|
|
||||||
when:
|
when:
|
||||||
- event: pull_request
|
- event: pull_request
|
||||||
|
@ -1,7 +1,16 @@
|
|||||||
# Runs all the unit test with coverage and generates a report.
|
# Runs all the unit test with coverage and generates a report.
|
||||||
|
#
|
||||||
# Note that
|
# Note that
|
||||||
|
#
|
||||||
# 1. This runs only after security, lint, mypy and docs checks have passed.
|
# 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.
|
# 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:
|
when:
|
||||||
- event: pull_request
|
- event: pull_request
|
||||||
@ -13,8 +22,10 @@ steps:
|
|||||||
image: python:${TAG}
|
image: python:${TAG}
|
||||||
commands:
|
commands:
|
||||||
- pip install uv
|
- 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 export --format requirements.txt > requirements.txt
|
||||||
- uv pip install --system -r 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 run --concurrency=thread -m pytest --doctest-modules --slow
|
||||||
- coverage combine
|
- coverage combine
|
||||||
- coverage report -m
|
- coverage report -m
|
||||||
@ -28,6 +39,7 @@ matrix:
|
|||||||
- 3.13
|
- 3.13
|
||||||
|
|
||||||
depends_on:
|
depends_on:
|
||||||
|
# See files of the same name here.
|
||||||
- security
|
- security
|
||||||
- lint
|
- lint
|
||||||
- mypy
|
- mypy
|
||||||
|
Loading…
x
Reference in New Issue
Block a user