Skip to content

Commit 3c26fc3

Browse files
committed
sync with main
2 parents 679ae00 + 4bea463 commit 3c26fc3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+3429
-907
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/labeler.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ internal:
1515
- scripts/**
1616
- .gitignore
1717
- .pre-commit-config.yaml
18-
- pdm_build.py
1918
- requirements*.txt
19+
- uv.lock
2020
- all-globs-to-all-files:
2121
- '!README.md'
2222
- '!src/**'
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: "Conflict detector"
2+
on:
3+
push:
4+
pull_request_target:
5+
types: [synchronize]
6+
7+
jobs:
8+
main:
9+
permissions:
10+
contents: read
11+
pull-requests: write
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Check if PRs have merge conflicts
15+
uses: eps1lon/actions-label-merge-conflict@v3
16+
with:
17+
dirtyLabel: "conflicts"
18+
repoToken: "${{ secrets.GITHUB_TOKEN }}"
19+
commentOnDirty: "This pull request has a merge conflict that needs to be resolved."

.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/labeler.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
pull-requests: write
1717
runs-on: ubuntu-latest
1818
steps:
19-
- uses: actions/labeler@v5
19+
- uses: actions/labeler@v6
2020
if: ${{ github.event.action != 'labeled' && github.event.action != 'unlabeled' }}
2121
- run: echo "Done adding labels"
2222
# Run this after labeler applied labels

.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@v4
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.3.1
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 --extra standard
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: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,22 @@ on:
88
jobs:
99
publish:
1010
runs-on: ubuntu-latest
11-
strategy:
12-
matrix:
13-
package:
14-
- fastapi-cli-slim
15-
- fastapi-cli
1611
permissions:
1712
id-token: write
13+
contents: read
1814
steps:
1915
- name: Dump GitHub context
2016
env:
2117
GITHUB_CONTEXT: ${{ toJson(github) }}
2218
run: echo "$GITHUB_CONTEXT"
23-
- uses: actions/checkout@v4
19+
- uses: actions/checkout@v6
2420
- name: Set up Python
25-
uses: actions/setup-python@v5
21+
uses: actions/setup-python@v6
2622
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
23+
python-version-file: ".python-version"
24+
- name: Install uv
25+
uses: astral-sh/setup-uv@v7
3326
- name: Build distribution
34-
env:
35-
TIANGOLO_BUILD_PACKAGE: ${{ matrix.package }}
36-
run: python -m build
27+
run: uv build
3728
- name: Publish
38-
uses: pypa/gh-action-pypi-publish@v1.9.0
29+
run: uv publish

.github/workflows/smokeshow.yml

Lines changed: 8 additions & 14 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@v4
24-
- uses: actions/setup-python@v5
19+
- uses: actions/checkout@v6
20+
- 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@v3
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@v4
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: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,22 @@ on:
1212
jobs:
1313
test-redistribute:
1414
runs-on: ubuntu-latest
15-
strategy:
16-
matrix:
17-
package:
18-
- fastapi-cli-slim
19-
- fastapi-cli
2015
steps:
2116
- name: Dump GitHub context
2217
env:
2318
GITHUB_CONTEXT: ${{ toJson(github) }}
2419
run: echo "$GITHUB_CONTEXT"
25-
- uses: actions/checkout@v4
20+
- uses: actions/checkout@v6
2621
- name: Set up Python
27-
uses: actions/setup-python@v5
22+
uses: actions/setup-python@v6
2823
with:
29-
python-version: "3.10"
24+
python-version-file: ".python-version"
3025
# Issue ref: https://github.com/actions/setup-python/issues/436
3126
# cache: "pip"
3227
# cache-dependency-path: pyproject.toml
3328
- name: Install build dependencies
3429
run: pip install build
3530
- name: Build source distribution
36-
env:
37-
TIANGOLO_BUILD_PACKAGE: ${{ matrix.package }}
3831
run: python -m build --sdist
3932
- name: Decompress source distribution
4033
run: |
@@ -43,9 +36,7 @@ jobs:
4336
- name: Install test dependencies
4437
run: |
4538
cd dist/fastapi_cli*/
46-
pip install -r requirements-tests.txt
47-
env:
48-
TIANGOLO_BUILD_PACKAGE: ${{ matrix.package }}
39+
pip install --group tests --editable .[standard]
4940
- name: Run source distribution tests
5041
run: |
5142
cd dist/fastapi_cli*/

0 commit comments

Comments
 (0)