fastapi-router-versioning 0.2.2__tar.gz → 0.2.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. {fastapi_router_versioning-0.2.2 → fastapi_router_versioning-0.2.4}/.github/dependabot.yml +11 -6
  2. fastapi_router_versioning-0.2.4/.github/labeler.yml +22 -0
  3. fastapi_router_versioning-0.2.4/.github/workflows/create-draft-release.yml +56 -0
  4. fastapi_router_versioning-0.2.4/.github/workflows/guard-dependencies.yml +53 -0
  5. fastapi_router_versioning-0.2.4/.github/workflows/labeler.yml +37 -0
  6. fastapi_router_versioning-0.2.4/.github/workflows/latest-changes.yml +50 -0
  7. {fastapi_router_versioning-0.2.2 → fastapi_router_versioning-0.2.4}/.github/workflows/pre-commit.yml +5 -6
  8. {fastapi_router_versioning-0.2.2 → fastapi_router_versioning-0.2.4}/.github/workflows/prepare-release.yml +10 -6
  9. {fastapi_router_versioning-0.2.2 → fastapi_router_versioning-0.2.4}/.github/workflows/publish.yml +1 -1
  10. {fastapi_router_versioning-0.2.2 → fastapi_router_versioning-0.2.4}/.github/workflows/test-redistribute.yml +4 -6
  11. {fastapi_router_versioning-0.2.2 → fastapi_router_versioning-0.2.4}/.github/workflows/test.yml +36 -14
  12. fastapi_router_versioning-0.2.4/.github/workflows/zizmor.yml +25 -0
  13. {fastapi_router_versioning-0.2.2 → fastapi_router_versioning-0.2.4}/.pre-commit-config.yaml +2 -2
  14. {fastapi_router_versioning-0.2.2 → fastapi_router_versioning-0.2.4}/LICENSE +1 -1
  15. fastapi_router_versioning-0.2.4/PKG-INFO +492 -0
  16. fastapi_router_versioning-0.2.4/README.md +461 -0
  17. {fastapi_router_versioning-0.2.2 → fastapi_router_versioning-0.2.4}/RELEASE_NOTES.md +19 -0
  18. {fastapi_router_versioning-0.2.2 → fastapi_router_versioning-0.2.4}/fastapi_router_versioning/__init__.py +1 -1
  19. {fastapi_router_versioning-0.2.2 → fastapi_router_versioning-0.2.4}/pyproject.toml +2 -0
  20. fastapi_router_versioning-0.2.4/scripts/test.sh +6 -0
  21. {fastapi_router_versioning-0.2.2 → fastapi_router_versioning-0.2.4}/uv.lock +43 -43
  22. fastapi_router_versioning-0.2.2/PKG-INFO +0 -472
  23. fastapi_router_versioning-0.2.2/README.md +0 -443
  24. fastapi_router_versioning-0.2.2/scripts/test-cov.sh +0 -6
  25. {fastapi_router_versioning-0.2.2 → fastapi_router_versioning-0.2.4}/.github/workflows/detect-conflicts.yml +0 -0
  26. {fastapi_router_versioning-0.2.2 → fastapi_router_versioning-0.2.4}/.gitignore +0 -0
  27. {fastapi_router_versioning-0.2.2 → fastapi_router_versioning-0.2.4}/.python-version +0 -0
  28. {fastapi_router_versioning-0.2.2 → fastapi_router_versioning-0.2.4}/examples/calver_app.py +0 -0
  29. {fastapi_router_versioning-0.2.2 → fastapi_router_versioning-0.2.4}/examples/download_static_assets.py +0 -0
  30. {fastapi_router_versioning-0.2.2 → fastapi_router_versioning-0.2.4}/examples/mounted_subapps_app.py +0 -0
  31. {fastapi_router_versioning-0.2.2 → fastapi_router_versioning-0.2.4}/examples/multi_router_app.py +0 -0
  32. {fastapi_router_versioning-0.2.2 → fastapi_router_versioning-0.2.4}/examples/openapi_hook_app.py +0 -0
  33. {fastapi_router_versioning-0.2.2 → fastapi_router_versioning-0.2.4}/examples/self_hosted_docs_app.py +0 -0
  34. {fastapi_router_versioning-0.2.2 → fastapi_router_versioning-0.2.4}/examples/semver_app.py +0 -0
  35. {fastapi_router_versioning-0.2.2 → fastapi_router_versioning-0.2.4}/examples/semver_major_only_app.py +0 -0
  36. {fastapi_router_versioning-0.2.2 → fastapi_router_versioning-0.2.4}/examples/validation_error_code_app.py +0 -0
  37. {fastapi_router_versioning-0.2.2 → fastapi_router_versioning-0.2.4}/examples/validation_error_code_custom_handler_app.py +0 -0
  38. {fastapi_router_versioning-0.2.2 → fastapi_router_versioning-0.2.4}/examples/webhook_versioning_app.py +0 -0
  39. {fastapi_router_versioning-0.2.2 → fastapi_router_versioning-0.2.4}/fastapi_router_versioning/py.typed +0 -0
  40. {fastapi_router_versioning-0.2.2 → fastapi_router_versioning-0.2.4}/fastapi_router_versioning/versioner.py +0 -0
  41. {fastapi_router_versioning-0.2.2 → fastapi_router_versioning-0.2.4}/scripts/format.sh +0 -0
  42. {fastapi_router_versioning-0.2.2 → fastapi_router_versioning-0.2.4}/scripts/lint.sh +0 -0
  43. {fastapi_router_versioning-0.2.2 → fastapi_router_versioning-0.2.4}/scripts/prepare_release.py +0 -0
  44. {fastapi_router_versioning-0.2.2 → fastapi_router_versioning-0.2.4}/scripts/test-cov-html.sh +0 -0
  45. /fastapi_router_versioning-0.2.2/scripts/test.sh → /fastapi_router_versioning-0.2.4/scripts/test-cov.sh +0 -0
  46. {fastapi_router_versioning-0.2.2 → fastapi_router_versioning-0.2.4}/tests/__init__.py +0 -0
  47. {fastapi_router_versioning-0.2.2 → fastapi_router_versioning-0.2.4}/tests/test_calver.py +0 -0
  48. {fastapi_router_versioning-0.2.2 → fastapi_router_versioning-0.2.4}/tests/test_fastapi_integration.py +0 -0
  49. {fastapi_router_versioning-0.2.2 → fastapi_router_versioning-0.2.4}/tests/test_prepare_release.py +0 -0
  50. {fastapi_router_versioning-0.2.2 → fastapi_router_versioning-0.2.4}/tests/test_semver.py +0 -0
  51. {fastapi_router_versioning-0.2.2 → fastapi_router_versioning-0.2.4}/tests/test_versioner.py +0 -0
@@ -1,5 +1,6 @@
1
1
  version: 2
2
2
  updates:
3
+ # GitHub Actions
3
4
  - package-ecosystem: "github-actions"
4
5
  directory: "/"
5
6
  schedule:
@@ -7,14 +8,16 @@ updates:
7
8
  cooldown:
8
9
  default-days: 7
9
10
  commit-message:
10
- prefix: "chore(actions)"
11
+ prefix:
11
12
  labels:
13
+ - "internal"
12
14
  - "dependencies"
15
+ - "github_actions"
13
16
  groups:
14
17
  github-actions:
15
18
  patterns:
16
19
  - "*"
17
-
20
+ # Python
18
21
  - package-ecosystem: "uv"
19
22
  directory: "/"
20
23
  schedule:
@@ -22,13 +25,13 @@ updates:
22
25
  cooldown:
23
26
  default-days: 7
24
27
  commit-message:
25
- prefix: "chore(deps)"
28
+ prefix:
26
29
  groups:
27
- python-dev:
30
+ python-packages:
28
31
  dependency-type: "development"
29
32
  patterns:
30
33
  - "*"
31
-
34
+ # pre-commit
32
35
  - package-ecosystem: "pre-commit"
33
36
  directory: "/"
34
37
  schedule:
@@ -36,9 +39,11 @@ updates:
36
39
  cooldown:
37
40
  default-days: 7
38
41
  commit-message:
39
- prefix: "chore(pre-commit)"
42
+ prefix:
40
43
  labels:
44
+ - "internal"
41
45
  - "dependencies"
46
+ - "pre-commit"
42
47
  groups:
43
48
  pre-commit:
44
49
  patterns:
@@ -0,0 +1,22 @@
1
+ docs:
2
+ - all:
3
+ - changed-files:
4
+ - any-glob-to-any-file:
5
+ - README.md
6
+ - RELEASE_NOTES.md
7
+ - all-globs-to-all-files:
8
+ - '!fastapi_router_versioning/**'
9
+ - '!pyproject.toml'
10
+
11
+ internal:
12
+ - all:
13
+ - changed-files:
14
+ - any-glob-to-any-file:
15
+ - .github/**
16
+ - scripts/**
17
+ - .gitignore
18
+ - .pre-commit-config.yaml
19
+ - uv.lock
20
+ - all-globs-to-all-files:
21
+ - '!fastapi_router_versioning/**'
22
+ - '!pyproject.toml'
@@ -0,0 +1,56 @@
1
+ name: Create Draft Release
2
+
3
+ on:
4
+ pull_request:
5
+ types:
6
+ - closed
7
+
8
+ permissions: {}
9
+
10
+ jobs:
11
+ create-draft-release:
12
+ if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'release')
13
+ runs-on: ubuntu-latest
14
+ timeout-minutes: 5
15
+ permissions:
16
+ contents: write
17
+ env:
18
+ PREPARE_RELEASE_VERSION_FILE: fastapi_router_versioning/__init__.py
19
+ PREPARE_RELEASE_RELEASE_NOTES_FILE: RELEASE_NOTES.md
20
+ steps:
21
+ - name: Dump GitHub context
22
+ env:
23
+ GITHUB_CONTEXT: ${{ toJson(github) }}
24
+ run: echo "$GITHUB_CONTEXT"
25
+ - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
26
+ with:
27
+ ref: ${{ github.event.repository.default_branch }}
28
+ persist-credentials: true
29
+ - name: Set up Python
30
+ uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
31
+ with:
32
+ python-version-file: ".python-version"
33
+ - name: Install uv
34
+ uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
35
+ with:
36
+ # Before upgrading uv version, make sure astral-sh/setup-uv knows its checksum.
37
+ # See: https://github.com/astral-sh/setup-uv/issues/851#issuecomment-4282017837
38
+ version: "0.11.18"
39
+ - name: Extract release details
40
+ id: release-details
41
+ run: |
42
+ set -euo pipefail
43
+ version="$(uv run python scripts/prepare_release.py current-version)"
44
+ uv run python scripts/prepare_release.py release-notes > draft-release-notes.md
45
+ echo "version=$version" >> "$GITHUB_OUTPUT"
46
+ - name: Create draft release
47
+ env:
48
+ GH_TOKEN: ${{ github.token }}
49
+ VERSION: ${{ steps.release-details.outputs.version }}
50
+ run: |
51
+ set -euo pipefail
52
+ gh release create "$VERSION" \
53
+ --draft \
54
+ --title "$VERSION" \
55
+ --notes-file draft-release-notes.md \
56
+ --target "$(git rev-parse HEAD)"
@@ -0,0 +1,53 @@
1
+ name: Guard Dependencies
2
+
3
+ on:
4
+ pull_request_target: # zizmor: ignore[dangerous-triggers] -- This workflow only reads context.payload metadata, never checks out PR code
5
+ branches: [main]
6
+ paths:
7
+ - pyproject.toml
8
+ - uv.lock
9
+
10
+ permissions:
11
+ contents: read
12
+ issues: write
13
+ pull-requests: write
14
+
15
+ jobs:
16
+ check-author:
17
+ runs-on: ubuntu-latest
18
+ timeout-minutes: 5
19
+ steps:
20
+ - name: Check if author is org member or allowed bot
21
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
22
+ with:
23
+ script: |
24
+ const pr = context.payload.pull_request;
25
+ const author = pr.user.login;
26
+ const assoc = pr.author_association;
27
+
28
+ const botAllowlist = new Set(['dependabot[bot]']);
29
+ const orgAuthorAssociations = new Set(['MEMBER', 'OWNER']);
30
+
31
+ const allowed =
32
+ botAllowlist.has(author) ||
33
+ (assoc != null && orgAuthorAssociations.has(assoc));
34
+
35
+ if (!allowed) {
36
+ await github.rest.issues.createComment({
37
+ owner: context.repo.owner,
38
+ repo: context.repo.repo,
39
+ issue_number: context.payload.pull_request.number,
40
+ body: `This PR modifies dependency files (\`pyproject.toml\` or \`uv.lock\`), which is restricted to members of the **${context.repo.owner}** organization on GitHub.\n\nIf you need a dependency change, please [open a discussion](https://github.com/${context.repo.owner}/${context.repo.repo}/discussions/new) describing what you need and why.\n\nClosing this PR automatically.`
41
+ });
42
+
43
+ await github.rest.pulls.update({
44
+ owner: context.repo.owner,
45
+ repo: context.repo.repo,
46
+ pull_number: context.payload.pull_request.number,
47
+ state: 'closed'
48
+ });
49
+
50
+ core.setFailed('Dependency changes are restricted to organization members.');
51
+ } else {
52
+ console.log(`Author ${author} (author_association=${assoc}) is allowed to make dependency changes.`);
53
+ }
@@ -0,0 +1,37 @@
1
+ name: Labels
2
+ on:
3
+ pull_request_target: # zizmor: ignore[dangerous-triggers]
4
+ types:
5
+ - opened
6
+ - synchronize
7
+ - reopened
8
+ # For label-checker
9
+ - labeled
10
+ - unlabeled
11
+
12
+ permissions: {}
13
+
14
+ jobs:
15
+ labeler:
16
+ permissions:
17
+ contents: read
18
+ pull-requests: write
19
+ runs-on: ubuntu-latest
20
+ timeout-minutes: 5
21
+ steps:
22
+ - uses: actions/labeler@f27b608878404679385c85cfa523b85ccb86e213 # v6.1.0
23
+ if: ${{ github.event.action != 'labeled' && github.event.action != 'unlabeled' }}
24
+ - run: echo "Done adding labels"
25
+ # Run this after labeler applied labels
26
+ check-labels:
27
+ needs:
28
+ - labeler
29
+ permissions:
30
+ pull-requests: read
31
+ runs-on: ubuntu-latest
32
+ timeout-minutes: 5
33
+ steps:
34
+ - uses: agilepathway/label-checker@c3d16ad512e7cea5961df85ff2486bb774caf3c5 # v1.6.65
35
+ with:
36
+ one_of: breaking,security,feature,bug,refactor,upgrade,docs,internal,release
37
+ repo_token: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,50 @@
1
+ name: Latest Changes
2
+
3
+ on:
4
+ pull_request_target: # zizmor: ignore[dangerous-triggers]
5
+ branches:
6
+ - main
7
+ types:
8
+ - closed
9
+ workflow_dispatch:
10
+ inputs:
11
+ number:
12
+ description: PR number
13
+ required: true
14
+ debug_enabled:
15
+ description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
16
+ required: false
17
+ default: 'false'
18
+
19
+ permissions: {}
20
+
21
+ jobs:
22
+ latest-changes:
23
+ runs-on: ubuntu-latest
24
+ if: github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true
25
+ timeout-minutes: 5
26
+ steps:
27
+ - name: Dump GitHub context
28
+ env:
29
+ GITHUB_CONTEXT: ${{ toJson(github) }}
30
+ run: echo "$GITHUB_CONTEXT"
31
+ - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
32
+ with:
33
+ ref: ${{ github.event.repository.default_branch }}
34
+ # To allow latest-changes to commit to the main branch
35
+ token: ${{ secrets.FASTAPI_ROUTER_VERSIONING_LATEST_CHANGES }} # zizmor: ignore[secrets-outside-env]
36
+ persist-credentials: true # required by tiangolo/latest-changes
37
+ # Allow debugging with tmate
38
+ - name: Setup tmate session
39
+ uses: mxschmitt/action-tmate@35b54afac29c97fb54faba5b513f8fbd1882f113 # v3.24
40
+ if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled == 'true' }}
41
+ with:
42
+ limit-access-to-actor: true
43
+ - uses: tiangolo/latest-changes@c9b73efbc8992ef1a401e4235ea307a8ca8a724b # 0.6.1
44
+ with:
45
+ token: ${{ secrets.GITHUB_TOKEN }}
46
+ latest_changes_file: RELEASE_NOTES.md
47
+ latest_changes_header: '## Latest Changes'
48
+ end_regex: '^## '
49
+ debug_logs: true
50
+ label_header_prefix: '### '
@@ -2,9 +2,6 @@ name: pre-commit
2
2
 
3
3
  on:
4
4
  pull_request:
5
- types:
6
- - opened
7
- - synchronize
8
5
 
9
6
  permissions: {}
10
7
 
@@ -28,13 +25,15 @@ jobs:
28
25
  fetch-depth: 0
29
26
 
30
27
  - name: Set up Python
31
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
28
+ uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
32
29
  with:
33
30
  python-version-file: ".python-version"
34
31
 
35
32
  - name: Setup uv
36
33
  uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
37
34
  with:
35
+ # Before upgrading uv version, make sure astral-sh/setup-uv knows its checksum.
36
+ # See: https://github.com/astral-sh/setup-uv/issues/851#issuecomment-4282017837
38
37
  version: "0.11.18"
39
38
  cache-dependency-glob: |
40
39
  pyproject.toml
@@ -47,8 +46,8 @@ jobs:
47
46
  # Only lint files changed in this PR, not the entire repo
48
47
  run: uv run prek run --from-ref origin/${GITHUB_BASE_REF} --to-ref HEAD --show-diff-on-failure
49
48
 
50
- # Required by GitHub branch protection rules
51
- pre-commit-alls-green:
49
+ # https://github.com/marketplace/actions/alls-green#why
50
+ pre-commit-alls-green: # This job does nothing and is only used for the branch protection
52
51
  if: always()
53
52
  needs:
54
53
  - pre-commit
@@ -18,10 +18,6 @@ on:
18
18
 
19
19
  permissions: {}
20
20
 
21
- env:
22
- PREPARE_RELEASE_VERSION_FILE: fastapi_router_versioning/__init__.py
23
- PREPARE_RELEASE_RELEASE_NOTES_FILE: RELEASE_NOTES.md
24
-
25
21
  jobs:
26
22
  prepare-release:
27
23
  runs-on: ubuntu-latest
@@ -30,12 +26,20 @@ jobs:
30
26
  contents: write
31
27
  issues: write
32
28
  pull-requests: write
29
+ env:
30
+ PREPARE_RELEASE_VERSION_FILE: fastapi_router_versioning/__init__.py
31
+ PREPARE_RELEASE_RELEASE_NOTES_FILE: RELEASE_NOTES.md
33
32
  steps:
33
+ - name: Dump GitHub context
34
+ env:
35
+ GITHUB_CONTEXT: ${{ toJson(github) }}
36
+ run: echo "$GITHUB_CONTEXT"
34
37
  - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
35
38
  with:
39
+ token: ${{ secrets.FASTAPI_ROUTER_VERSIONING_LATEST_CHANGES }} # zizmor: ignore[secrets-outside-env]
36
40
  persist-credentials: true
37
41
  - name: Set up Python
38
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
42
+ uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
39
43
  with:
40
44
  python-version-file: ".python-version"
41
45
  - name: Install uv
@@ -62,7 +66,7 @@ jobs:
62
66
  gh label create release --color 0075ca --description "Release PR" 2>/dev/null || true
63
67
  - name: Create release pull request
64
68
  env:
65
- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69
+ GH_TOKEN: ${{ secrets.FASTAPI_ROUTER_VERSIONING_LATEST_CHANGES }}
66
70
  VERSION: ${{ steps.release-version.outputs.version }}
67
71
  run: |
68
72
  set -euo pipefail
@@ -24,7 +24,7 @@ jobs:
24
24
  with:
25
25
  persist-credentials: false
26
26
  - name: Set up Python
27
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
27
+ uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
28
28
  with:
29
29
  python-version-file: ".python-version"
30
30
  - name: Install uv
@@ -5,9 +5,6 @@ on:
5
5
  branches:
6
6
  - main
7
7
  pull_request:
8
- types:
9
- - opened
10
- - synchronize
11
8
 
12
9
  permissions: {}
13
10
 
@@ -15,6 +12,7 @@ jobs:
15
12
  changes:
16
13
  runs-on: ubuntu-latest
17
14
  permissions:
15
+ contents: read
18
16
  pull-requests: read
19
17
  timeout-minutes: 5
20
18
  outputs:
@@ -23,7 +21,7 @@ jobs:
23
21
  - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
24
22
  with:
25
23
  persist-credentials: false
26
- - uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
24
+ - uses: dorny/paths-filter@7b450fff21473bca461d4b92ce414b9d0420d706 # v4.0.2
27
25
  id: filter
28
26
  with:
29
27
  filters: |
@@ -52,7 +50,7 @@ jobs:
52
50
  with:
53
51
  persist-credentials: false
54
52
  - name: Set up Python
55
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
53
+ uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
56
54
  with:
57
55
  python-version-file: ".python-version"
58
56
  - name: Install build dependencies
@@ -77,7 +75,7 @@ jobs:
77
75
  pip wheel --no-deps fastapi_router_versioning*.tar.gz
78
76
 
79
77
  # https://github.com/marketplace/actions/alls-green#why
80
- test-redistribute-alls-green:
78
+ test-redistribute-alls-green: # This job does nothing and is only used for the branch protection
81
79
  if: always()
82
80
  needs:
83
81
  - test-redistribute
@@ -5,10 +5,8 @@ on:
5
5
  branches:
6
6
  - main
7
7
  pull_request:
8
- types:
9
- - opened
10
- - synchronize
11
8
  schedule:
9
+ # cron every week on monday
12
10
  - cron: "0 0 * * 1"
13
11
 
14
12
  permissions: {}
@@ -19,16 +17,20 @@ env:
19
17
  jobs:
20
18
  changes:
21
19
  runs-on: ubuntu-latest
20
+ # Required permissions
22
21
  permissions:
22
+ contents: read
23
23
  pull-requests: read
24
24
  timeout-minutes: 5
25
+ # Set job outputs to values from filter step
25
26
  outputs:
26
27
  src: ${{ steps.filter.outputs.src }}
27
28
  steps:
28
29
  - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
29
30
  with:
30
31
  persist-credentials: false
31
- - uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
32
+ # For pull requests it's not necessary to checkout the code but for the main branch it is
33
+ - uses: dorny/paths-filter@7b450fff21473bca461d4b92ce414b9d0420d706 # v4.0.2
32
34
  id: filter
33
35
  with:
34
36
  filters: |
@@ -75,21 +77,23 @@ jobs:
75
77
  persist-credentials: false
76
78
 
77
79
  - name: Set up Python
78
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
80
+ uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
79
81
  with:
80
82
  python-version: ${{ matrix.python-version }}
81
83
 
82
84
  - name: Setup uv
83
85
  uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
84
86
  with:
87
+ # Before upgrading uv version, make sure astral-sh/setup-uv knows its checksum.
88
+ # See: https://github.com/astral-sh/setup-uv/issues/851#issuecomment-4282017837
85
89
  version: "0.11.18"
86
90
  enable-cache: true
87
- cache-suffix: ${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.uv-resolution }}-fa${{ matrix.fastapi-version }}
91
+ cache-suffix: ${{ matrix.python-version }}-fa${{ matrix.fastapi-version }}
88
92
  cache-dependency-glob: |
89
93
  pyproject.toml
90
94
  uv.lock
91
95
 
92
- - name: Install dependencies
96
+ - name: Install Dependencies
93
97
  run: uv sync
94
98
 
95
99
  - name: Override FastAPI version
@@ -100,17 +104,16 @@ jobs:
100
104
  run: mkdir coverage
101
105
 
102
106
  - name: Test
103
- # GitHub Windows runners ship bash natively
104
- run: uv run --no-sync bash scripts/test.sh
107
+ run: uv run --no-sync bash scripts/test-cov.sh
105
108
  env:
106
- COVERAGE_FILE: coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }}-fa${{ matrix.fastapi-version }}
107
- CONTEXT: ${{ runner.os }}-py${{ matrix.python-version }}-fa${{ matrix.fastapi-version }}
109
+ COVERAGE_FILE: coverage/.coverage.py${{ matrix.python-version }}-fa${{ matrix.fastapi-version }}
110
+ CONTEXT: py${{ matrix.python-version }}-fa${{ matrix.fastapi-version }}
108
111
 
109
112
  - name: Store coverage files
110
113
  if: matrix.coverage == 'coverage'
111
114
  uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
112
115
  with:
113
- name: coverage-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.fastapi-version }}
116
+ name: coverage-${{ matrix.python-version }}-${{ matrix.fastapi-version }}
114
117
  path: coverage
115
118
  include-hidden-files: true
116
119
 
@@ -122,6 +125,11 @@ jobs:
122
125
  permissions:
123
126
  contents: read
124
127
  steps:
128
+ - name: Dump GitHub context
129
+ env:
130
+ GITHUB_CONTEXT: ${{ toJson(github) }}
131
+ run: echo "$GITHUB_CONTEXT"
132
+
125
133
  - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
126
134
  with:
127
135
  persist-credentials: false
@@ -129,6 +137,8 @@ jobs:
129
137
  - name: Setup uv
130
138
  uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
131
139
  with:
140
+ # Before upgrading uv version, make sure astral-sh/setup-uv knows its checksum.
141
+ # See: https://github.com/astral-sh/setup-uv/issues/851#issuecomment-4282017837
132
142
  version: "0.11.18"
133
143
  enable-cache: true
134
144
  cache-dependency-glob: |
@@ -148,6 +158,7 @@ jobs:
148
158
  - run: ls -la coverage
149
159
  - run: uv run coverage combine coverage
150
160
  - run: uv run coverage html --title "Coverage for ${{ github.sha }}"
161
+ - run: uv run coverage xml
151
162
 
152
163
  - name: Store coverage HTML
153
164
  uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
@@ -156,17 +167,28 @@ jobs:
156
167
  path: htmlcov
157
168
  include-hidden-files: true
158
169
 
170
+ - name: Upload coverage to Codecov
171
+ uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
172
+ with:
173
+ token: ${{ secrets.CODECOV_TOKEN }}
174
+ files: coverage.xml
175
+ fail_ci_if_error: true
176
+
159
177
  - run: uv run coverage report --fail-under=100
160
178
 
161
- check:
179
+ # https://github.com/marketplace/actions/alls-green#why
180
+ test-alls-green: # This job does nothing and is only used for the branch protection
162
181
  if: always()
163
182
  needs:
164
183
  - test
165
184
  - coverage-combine
166
185
  runs-on: ubuntu-latest
167
186
  timeout-minutes: 5
168
- permissions: {}
169
187
  steps:
188
+ - name: Dump GitHub context
189
+ env:
190
+ GITHUB_CONTEXT: ${{ toJson(github) }}
191
+ run: echo "$GITHUB_CONTEXT"
170
192
  - name: Decide whether the needed jobs succeeded or failed
171
193
  uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # v1.2.2
172
194
  with:
@@ -0,0 +1,25 @@
1
+ name: Zizmor
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ pull_request:
8
+ workflow_dispatch:
9
+
10
+ permissions: {}
11
+
12
+ jobs:
13
+ zizmor:
14
+ name: Run zizmor
15
+ runs-on: ubuntu-latest
16
+ timeout-minutes: 5
17
+ permissions:
18
+ security-events: write # Required for upload-sarif (used by zizmor-action) to upload SARIF files.
19
+ steps:
20
+ - name: Checkout repository
21
+ uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
22
+ with:
23
+ persist-credentials: false
24
+ - name: Run zizmor
25
+ uses: zizmorcore/zizmor-action@192e21d79ab29983730a13d1382995c2307fbcaa # v0.5.7
@@ -18,7 +18,7 @@ repos:
18
18
  rev: b859c0df7f391deba73030f79b957e62b4d81dc6 # varcon-core-v5.0.7
19
19
  hooks:
20
20
  - id: typos
21
- args: [--force-exclude]
21
+ args: [ --force-exclude ]
22
22
 
23
23
  - repo: local
24
24
  hooks:
@@ -54,6 +54,6 @@ repos:
54
54
  name: zizmor
55
55
  language: python
56
56
  entry: uv run zizmor .
57
- files: ^\.github/workflows/
57
+ files: ^\.github/workflows/|^uv\.lock$
58
58
  require_serial: true
59
59
  pass_filenames: false
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2018 Sebastián Ramírez
3
+ Copyright (c) 2026 Matteo Nieddu
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal