Compare commits
7
Commits
v0.5.0
...
e39fc96ac1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e39fc96ac1 | ||
|
|
c1f4826d78 | ||
|
|
0315a33a3b | ||
|
|
5d33ec6091 | ||
|
|
9538e4d26d | ||
|
|
14b8d2798c | ||
|
|
d3cbb65bbc |
@@ -2,9 +2,11 @@
|
||||
|
||||
If this PR changes files under `python_repositories/`, the **title must** start with one of:
|
||||
|
||||
- `[patch]` or `[fix]` — bug fix (0.3.1 → 0.3.2)
|
||||
- `[minor]` or `[feat]` — new feature (0.3.1 → 0.4.0)
|
||||
- `[major]` or `[breaking]` — breaking change (0.3.1 → 1.0.0)
|
||||
- `[patch]` or `[fix]` — bug fix (`1.2.3` → `1.2.4`)
|
||||
- `[minor]` or `[feat]` — new feature (`1.2.3` → `1.3.0`)
|
||||
- `[major]` or `[breaking]` — breaking change (`1.2.3` → `2.0.0`)
|
||||
|
||||
Current version: see [`pyproject.toml`](pyproject.toml) on `main`.
|
||||
|
||||
Docs-, CI-, or test-only PRs do not need a prefix.
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
unit-tests:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
@@ -26,10 +26,94 @@ jobs:
|
||||
UV_LINK_MODE: copy
|
||||
run: uv sync --all-extras
|
||||
|
||||
- name: Run pytest
|
||||
- name: Run unit tests
|
||||
run: |
|
||||
uv run pytest tests/unit/ -m "not integration" \
|
||||
--cov=python_repositories \
|
||||
--cov-report=
|
||||
|
||||
- name: Upload unit coverage
|
||||
uses: https://github.com/christopherHX/gitea-upload-artifact@v4
|
||||
with:
|
||||
name: coverage-unit
|
||||
path: .coverage
|
||||
retention-days: 1
|
||||
compression-level: 0
|
||||
|
||||
integration-tests:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version-file: .python-version
|
||||
|
||||
- name: Install uv
|
||||
run: pip install uv
|
||||
|
||||
- name: Install dependencies
|
||||
env:
|
||||
PYTHONPATH: .
|
||||
run: uv run pytest --cov=python_repositories --cov-report=term-missing > coverage.txt
|
||||
UV_LINK_MODE: copy
|
||||
run: uv sync --all-extras
|
||||
|
||||
- name: Verify Docker
|
||||
run: docker info
|
||||
|
||||
- name: Run integration tests
|
||||
run: |
|
||||
uv run pytest -m integration \
|
||||
--cov=python_repositories \
|
||||
--cov-report=
|
||||
|
||||
- name: Upload integration coverage
|
||||
uses: https://github.com/christopherHX/gitea-upload-artifact@v4
|
||||
with:
|
||||
name: coverage-integration
|
||||
path: .coverage
|
||||
retention-days: 1
|
||||
compression-level: 0
|
||||
|
||||
coverage-report:
|
||||
needs: [unit-tests, integration-tests]
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name == 'pull_request' || github.event_name == 'push'
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version-file: .python-version
|
||||
|
||||
- name: Install uv
|
||||
run: pip install uv
|
||||
|
||||
- name: Install dependencies
|
||||
env:
|
||||
UV_LINK_MODE: copy
|
||||
run: uv sync --all-extras
|
||||
|
||||
- name: Download unit coverage
|
||||
uses: https://github.com/christopherHX/gitea-download-artifact@v4
|
||||
with:
|
||||
name: coverage-unit
|
||||
path: coverage-unit
|
||||
|
||||
- name: Download integration coverage
|
||||
uses: https://github.com/christopherHX/gitea-download-artifact@v4
|
||||
with:
|
||||
name: coverage-integration
|
||||
path: coverage-integration
|
||||
|
||||
- name: Combine coverage report
|
||||
run: |
|
||||
uv run coverage combine coverage-unit/.coverage coverage-integration/.coverage
|
||||
uv run coverage report -m --include='python_repositories/*' > coverage.txt
|
||||
cat coverage.txt
|
||||
|
||||
- name: Post coverage summary to PR
|
||||
if: github.event_name == 'pull_request'
|
||||
|
||||
@@ -148,6 +148,8 @@ uv run pytest -v # full suite (requires Doc
|
||||
|
||||
Integration tests are marked with `@pytest.mark.integration` and require Docker (testcontainers). Run unit tests alone for quick local feedback.
|
||||
|
||||
CI runs unit and integration tests in parallel with coverage, then merges `.coverage` artifacts in a follow-up job (via [christopherhx/gitea-\*-artifact@v4](https://github.com/christopherHX/gitea-upload-artifact) for Gitea 1.26 compatibility).
|
||||
|
||||
`pre-commit` is included in the dev dependency group. `uv sync` installs the CLI, but git does not run hooks until you install them with `pre-commit install` (one time per clone). After that, commits run the checks defined in [`.pre-commit-config.yaml`](.pre-commit-config.yaml) (ruff, mypy, pyupgrade, prettier, and general file hygiene).
|
||||
|
||||
To run all hooks manually without committing:
|
||||
@@ -173,9 +175,9 @@ Docs-, CI-, and test-only PRs do not need a prefix and will not trigger a releas
|
||||
|
||||
| Prefix | Bump | Example |
|
||||
| ------------------------- | ---------- | --------------------- |
|
||||
| `[patch]` or `[fix]` | patch | `0.3.1` → `0.3.2` |
|
||||
| `[minor]` or `[feat]` | minor | `0.3.1` → `0.4.0` |
|
||||
| `[major]` or `[breaking]` | major | `0.3.1` → `1.0.0` |
|
||||
| `[patch]` or `[fix]` | patch | `1.2.3` → `1.2.4` |
|
||||
| `[minor]` or `[feat]` | minor | `1.2.3` → `1.3.0` |
|
||||
| `[major]` or `[breaking]` | major | `1.2.3` → `2.0.0` |
|
||||
| _(none)_ | no release | docs / CI / deps only |
|
||||
|
||||
Example titles:
|
||||
@@ -189,4 +191,4 @@ Release notes are generated from commits since the previous tag (see [`scripts/c
|
||||
|
||||
### Manual release
|
||||
|
||||
You can still push a `v*.*.*` tag manually; `publish.yml` will build and publish. The current baseline version is **0.3.1**.
|
||||
You can still push a `v*.*.*` tag manually; `publish.yml` will build and publish. The current released version is in [`pyproject.toml`](pyproject.toml) (and on the latest `v*.*.*` tag).
|
||||
|
||||
Reference in New Issue
Block a user