Skip to content

Commit 3a0d187

Browse files
authored
Merge branch 'main' into main
2 parents c258aea + ccec548 commit 3a0d187

30 files changed

+2563
-109
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ updates:
88
commit-message:
99
prefix:
1010
# Python
11-
- package-ecosystem: "pip"
11+
- package-ecosystem: "uv"
1212
directory: "/"
1313
schedule:
1414
interval: "daily"

.github/workflows/issue-manager.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
env:
2828
GITHUB_CONTEXT: ${{ toJson(github) }}
2929
run: echo "$GITHUB_CONTEXT"
30-
- uses: tiangolo/issue-manager@0.5.1
30+
- uses: tiangolo/issue-manager@0.6.0
3131
with:
3232
token: ${{ secrets.GITHUB_TOKEN }}
3333
config: >
@@ -38,6 +38,10 @@ jobs:
3838
},
3939
"waiting": {
4040
"delay": 2628000,
41-
"message": "As this PR has been waiting for the original user for a while but seems to be inactive, it's now going to be closed. But if there's anyone interested, feel free to create a new PR."
41+
"message": "As this PR has been waiting for the original user for a while but seems to be inactive, it's now going to be closed. But if there's anyone interested, feel free to create a new PR.",
42+
"reminder": {
43+
"before": "P3D",
44+
"message": "Heads-up: this will be closed in 3 days unless there’s new activity."
45+
}
4246
}
4347
}

.github/workflows/latest-changes.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
env:
2525
GITHUB_CONTEXT: ${{ toJson(github) }}
2626
run: echo "$GITHUB_CONTEXT"
27-
- uses: actions/checkout@v5
27+
- uses: actions/checkout@v6
2828
with:
2929
# To allow latest-changes to commit to the main branch
3030
token: ${{ secrets.LATEST_CHANGES }}
@@ -34,7 +34,7 @@ jobs:
3434
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled == 'true' }}
3535
with:
3636
limit-access-to-actor: true
37-
- uses: tiangolo/latest-changes@0.4.0
37+
- uses: tiangolo/latest-changes@0.4.1
3838
with:
3939
token: ${{ secrets.GITHUB_TOKEN }}
4040
latest_changes_file: release-notes.md

.github/workflows/pre-commit.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: pre-commit
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- synchronize
8+
9+
env:
10+
# Forks and Dependabot don't have access to secrets
11+
HAS_SECRETS: ${{ secrets.PRE_COMMIT != '' }}
12+
13+
jobs:
14+
pre-commit:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Dump GitHub context
18+
env:
19+
GITHUB_CONTEXT: ${{ toJson(github) }}
20+
run: echo "$GITHUB_CONTEXT"
21+
- uses: actions/checkout@v6
22+
name: Checkout PR for own repo
23+
if: env.HAS_SECRETS == 'true'
24+
with:
25+
# To be able to commit it needs to fetch the head of the branch, not the
26+
# merge commit
27+
ref: ${{ github.head_ref }}
28+
# And it needs the full history to be able to compute diffs
29+
fetch-depth: 0
30+
# A token other than the default GITHUB_TOKEN is needed to be able to trigger CI
31+
token: ${{ secrets.PRE_COMMIT }}
32+
# pre-commit lite ci needs the default checkout configs to work
33+
- uses: actions/checkout@v6
34+
name: Checkout PR for fork
35+
if: env.HAS_SECRETS == 'false'
36+
with:
37+
# To be able to commit it needs the head branch of the PR, the remote one
38+
ref: ${{ github.event.pull_request.head.sha }}
39+
fetch-depth: 0
40+
- name: Set up Python
41+
uses: actions/setup-python@v6
42+
with:
43+
python-version-file: ".python-version"
44+
- name: Setup uv
45+
uses: astral-sh/setup-uv@v7
46+
with:
47+
cache-dependency-glob: |
48+
pyproject.toml
49+
uv.lock
50+
- name: Install Dependencies
51+
run: uv sync --locked
52+
- name: Run prek - pre-commit
53+
id: precommit
54+
run: uvx prek run --from-ref origin/${GITHUB_BASE_REF} --to-ref HEAD --show-diff-on-failure
55+
continue-on-error: true
56+
- name: Commit and push changes
57+
if: env.HAS_SECRETS == 'true'
58+
run: |
59+
git config user.name "github-actions[bot]"
60+
git config user.email "github-actions[bot]@users.noreply.github.com"
61+
git add -A
62+
if git diff --staged --quiet; then
63+
echo "No changes to commit"
64+
else
65+
git commit -m "🎨 Auto format"
66+
git push
67+
fi
68+
- uses: pre-commit-ci/lite-action@v1.1.0
69+
if: env.HAS_SECRETS == 'false'
70+
with:
71+
msg: 🎨 Auto format
72+
- name: Error out on pre-commit errors
73+
if: steps.precommit.outcome == 'failure'
74+
run: exit 1
75+
76+
# https://github.com/marketplace/actions/alls-green#why
77+
pre-commit-alls-green: # This job does nothing and is only used for the branch protection
78+
if: always()
79+
needs:
80+
- pre-commit
81+
runs-on: ubuntu-latest
82+
steps:
83+
- name: Dump GitHub context
84+
env:
85+
GITHUB_CONTEXT: ${{ toJson(github) }}
86+
run: echo "$GITHUB_CONTEXT"
87+
- name: Decide whether the needed jobs succeeded or failed
88+
uses: re-actors/alls-green@release/v1
89+
with:
90+
jobs: ${{ toJSON(needs) }}

.github/workflows/publish.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,22 @@ jobs:
1515
- fastapi-cli
1616
permissions:
1717
id-token: write
18+
contents: read
1819
steps:
1920
- name: Dump GitHub context
2021
env:
2122
GITHUB_CONTEXT: ${{ toJson(github) }}
2223
run: echo "$GITHUB_CONTEXT"
23-
- uses: actions/checkout@v5
24+
- uses: actions/checkout@v6
2425
- name: Set up Python
2526
uses: actions/setup-python@v6
2627
with:
27-
python-version: "3.10"
28-
# Issue ref: https://github.com/actions/setup-python/issues/436
29-
# cache: "pip"
30-
# cache-dependency-path: pyproject.toml
31-
- name: Install build dependencies
32-
run: pip install build
28+
python-version-file: ".python-version"
29+
- name: Install uv
30+
uses: astral-sh/setup-uv@v7
3331
- name: Build distribution
32+
run: uv build
3433
env:
3534
TIANGOLO_BUILD_PACKAGE: ${{ matrix.package }}
36-
run: python -m build
3735
- name: Publish
38-
uses: pypa/gh-action-pypi-publish@v1.13.0
36+
run: uv publish

.github/workflows/smokeshow.yml

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,38 +8,32 @@ on:
88
permissions:
99
statuses: write
1010

11-
env:
12-
UV_SYSTEM_PYTHON: 1
13-
1411
jobs:
1512
smokeshow:
16-
if: ${{ github.event.workflow_run.conclusion == 'success' }}
1713
runs-on: ubuntu-latest
1814
steps:
1915
- name: Dump GitHub context
2016
env:
2117
GITHUB_CONTEXT: ${{ toJson(github) }}
2218
run: echo "$GITHUB_CONTEXT"
23-
- uses: actions/checkout@v5
19+
- uses: actions/checkout@v6
2420
- uses: actions/setup-python@v6
2521
with:
26-
python-version: '3.9'
22+
python-version-file: ".python-version"
2723
- name: Setup uv
28-
uses: astral-sh/setup-uv@v6
24+
uses: astral-sh/setup-uv@v7
2925
with:
30-
version: "0.4.15"
31-
enable-cache: true
3226
cache-dependency-glob: |
33-
requirements**.txt
3427
pyproject.toml
35-
- run: uv pip install -r requirements-github-actions.txt
36-
- uses: actions/download-artifact@v5
28+
uv.lock
29+
- run: uv sync --locked --no-dev --group github-actions
30+
- uses: actions/download-artifact@v7
3731
with:
3832
name: coverage-html
3933
path: htmlcov
4034
github-token: ${{ secrets.GITHUB_TOKEN }}
4135
run-id: ${{ github.event.workflow_run.id }}
42-
- run: smokeshow upload htmlcov
36+
- run: uv run smokeshow upload htmlcov
4337
env:
4438
SMOKESHOW_GITHUB_STATUS_DESCRIPTION: Coverage {coverage-percentage}
4539
SMOKESHOW_GITHUB_COVERAGE_THRESHOLD: 100

.github/workflows/test-redistribute.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ jobs:
2222
env:
2323
GITHUB_CONTEXT: ${{ toJson(github) }}
2424
run: echo "$GITHUB_CONTEXT"
25-
- uses: actions/checkout@v5
25+
- uses: actions/checkout@v6
2626
- name: Set up Python
2727
uses: actions/setup-python@v6
2828
with:
29-
python-version: "3.10"
29+
python-version-file: ".python-version"
3030
# Issue ref: https://github.com/actions/setup-python/issues/436
3131
# cache: "pip"
3232
# cache-dependency-path: pyproject.toml
@@ -43,7 +43,7 @@ jobs:
4343
- name: Install test dependencies
4444
run: |
4545
cd dist/fastapi_cli*/
46-
pip install -r requirements-tests.txt
46+
pip install --group tests --editable .[standard]
4747
env:
4848
TIANGOLO_BUILD_PACKAGE: ${{ matrix.package }}
4949
- name: Run source distribution tests

.github/workflows/test.yml

Lines changed: 37 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -22,58 +22,66 @@ on:
2222
default: 'false'
2323

2424
env:
25-
UV_SYSTEM_PYTHON: 1
25+
UV_NO_SYNC: true
2626

2727
jobs:
2828
test:
29-
runs-on: ubuntu-latest
3029
strategy:
3130
matrix:
32-
python-version:
33-
- "3.8"
34-
- "3.9"
35-
- "3.10"
36-
- "3.11"
37-
- "3.12"
31+
os: [ ubuntu-latest, windows-latest, macos-latest ]
32+
python-version: ["3.14"]
33+
include:
34+
- python-version: "3.9"
35+
os: macos-latest
36+
- python-version: "3.10"
37+
os: ubuntu-latest
38+
- python-version: "3.11"
39+
os: windows-latest
40+
- python-version: "3.12"
41+
os: macos-latest
42+
- python-version: "3.13"
43+
os: ubuntu-latest
44+
- python-version: "3.13"
45+
os: windows-latest
3846
fail-fast: false
47+
runs-on: ${{ matrix.os }}
48+
env:
49+
UV_PYTHON: ${{ matrix.python-version }}
3950
steps:
4051
- name: Dump GitHub context
4152
env:
4253
GITHUB_CONTEXT: ${{ toJson(github) }}
4354
run: echo "$GITHUB_CONTEXT"
44-
- uses: actions/checkout@v5
55+
- uses: actions/checkout@v6
4556
- name: Set up Python
4657
uses: actions/setup-python@v6
4758
with:
4859
python-version: ${{ matrix.python-version }}
4960
- name: Setup uv
50-
uses: astral-sh/setup-uv@v6
61+
uses: astral-sh/setup-uv@v7
5162
with:
52-
version: "0.4.15"
5363
enable-cache: true
5464
cache-dependency-glob: |
55-
requirements**.txt
5665
pyproject.toml
66+
uv.lock
5767
# Allow debugging with tmate
5868
- name: Setup tmate session
5969
uses: mxschmitt/action-tmate@v3
6070
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled == 'true' }}
6171
with:
6272
limit-access-to-actor: true
6373
- name: Install Dependencies
64-
run: uv pip install -r requirements-tests.txt
65-
- name: Lint
66-
run: bash scripts/lint.sh
74+
run: uv sync --locked --no-dev --group tests --extra standard
6775
- run: mkdir coverage
6876
- name: Test
69-
run: bash scripts/test.sh
77+
run: uv run bash scripts/test.sh
7078
env:
7179
COVERAGE_FILE: coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }}
7280
CONTEXT: ${{ runner.os }}-py${{ matrix.python-version }}
7381
- name: Store coverage files
74-
uses: actions/upload-artifact@v4
82+
uses: actions/upload-artifact@v6
7583
with:
76-
name: coverage-${{ matrix.python-version }}
84+
name: coverage-${{ runner.os }}-${{ matrix.python-version }}
7785
path: coverage
7886
include-hidden-files: true
7987

@@ -85,35 +93,35 @@ jobs:
8593
env:
8694
GITHUB_CONTEXT: ${{ toJson(github) }}
8795
run: echo "$GITHUB_CONTEXT"
88-
- uses: actions/checkout@v5
96+
- uses: actions/checkout@v6
8997
- uses: actions/setup-python@v6
9098
with:
91-
python-version: '3.8'
99+
python-version-file: ".python-version"
92100
- name: Setup uv
93-
uses: astral-sh/setup-uv@v6
101+
uses: astral-sh/setup-uv@v7
94102
with:
95-
version: "0.4.15"
96103
enable-cache: true
97104
cache-dependency-glob: |
98-
requirements**.txt
99105
pyproject.toml
106+
uv.lock
100107
- name: Get coverage files
101-
uses: actions/download-artifact@v5
108+
uses: actions/download-artifact@v7
102109
with:
103110
pattern: coverage-*
104111
path: coverage
105112
merge-multiple: true
106-
- run: uv pip install -r requirements-tests.txt
113+
- name: Install dependencies
114+
run: uv sync --locked --no-dev --group tests --extra standard
107115
- run: ls -la coverage
108-
- run: coverage combine coverage
109-
- run: coverage report
110-
- run: coverage html --title "Coverage for ${{ github.sha }}"
116+
- run: uv run coverage combine coverage
117+
- run: uv run coverage html --title "Coverage for ${{ github.sha }}"
111118
- name: Store coverage HTML
112-
uses: actions/upload-artifact@v4
119+
uses: actions/upload-artifact@v6
113120
with:
114121
name: coverage-html
115122
path: htmlcov
116123
include-hidden-files: true
124+
- run: uv run coverage report --fail-under=100
117125

118126
# https://github.com/marketplace/actions/alls-green#why
119127
check: # This job does nothing and is only used for the branch protection

0 commit comments

Comments
 (0)