Skip to content

Commit 7e49bf1

Browse files
authored
Merge branch 'main' into dependabot/github_actions/actions/checkout-6
2 parents 7e971e0 + f79068b commit 7e49bf1

40 files changed

Lines changed: 3708 additions & 2365 deletions

.github/workflows/issue-manager.yml

Lines changed: 1 addition & 1 deletion
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: >

.github/workflows/pre-commit.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
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@v5
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@v5
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: "3.14"
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: Run prek - pre-commit
51+
id: precommit
52+
run: uvx prek run --from-ref origin/${GITHUB_BASE_REF} --to-ref HEAD --show-diff-on-failure
53+
continue-on-error: true
54+
- name: Commit and push changes
55+
if: env.HAS_SECRETS == 'true'
56+
run: |
57+
git config user.name "github-actions[bot]"
58+
git config user.email "github-actions[bot]@users.noreply.github.com"
59+
git add -A
60+
if git diff --staged --quiet; then
61+
echo "No changes to commit"
62+
else
63+
git commit -m "🎨 Auto format"
64+
git push
65+
fi
66+
- uses: pre-commit-ci/lite-action@v1.1.0
67+
if: env.HAS_SECRETS == 'false'
68+
with:
69+
msg: 🎨 Auto format
70+
- name: Error out on pre-commit errors
71+
if: steps.precommit.outcome == 'failure'
72+
run: exit 1
73+
74+
# https://github.com/marketplace/actions/alls-green#why
75+
pre-commit-alls-green: # This job does nothing and is only used for the branch protection
76+
if: always()
77+
needs:
78+
- pre-commit
79+
runs-on: ubuntu-latest
80+
steps:
81+
- name: Dump GitHub context
82+
env:
83+
GITHUB_CONTEXT: ${{ toJson(github) }}
84+
run: echo "$GITHUB_CONTEXT"
85+
- name: Decide whether the needed jobs succeeded or failed
86+
uses: re-actors/alls-green@release/v1
87+
with:
88+
jobs: ${{ toJSON(needs) }}

.github/workflows/smokeshow.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,20 @@ permissions:
1010

1111
jobs:
1212
smokeshow:
13-
if: ${{ github.event.workflow_run.conclusion == 'success' }}
1413
runs-on: ubuntu-latest
1514

1615
steps:
1716
- name: Dump GitHub context
1817
env:
1918
GITHUB_CONTEXT: ${{ toJson(github) }}
2019
run: echo "$GITHUB_CONTEXT"
21-
- uses: actions/setup-python@v5
20+
- uses: actions/setup-python@v6
2221
with:
23-
python-version: '3.9'
22+
python-version: '3.13'
2423

2524
- run: pip install smokeshow
2625

27-
- uses: actions/download-artifact@v5
26+
- uses: actions/download-artifact@v6
2827
with:
2928
name: coverage-html
3029
path: htmlcov

.github/workflows/test.yml

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,28 @@ jobs:
2525
test:
2626
strategy:
2727
matrix:
28-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
29-
pydantic-version: ["v2"]
28+
os: [ ubuntu-latest, macos-latest, windows-latest ]
29+
python-version: ["3.14"]
30+
uv-resolution:
31+
- highest
3032
include:
31-
- python-version: "3.8"
32-
pydantic-version: "v1"
33-
- python-version: "3.9"
34-
pydantic-version: "v1"
3533
- python-version: "3.10"
36-
pydantic-version: "v1"
34+
os: ubuntu-latest
35+
uv-resolution: lowest-direct
3736
- python-version: "3.11"
38-
pydantic-version: "v1"
37+
os: macos-latest
38+
uv-resolution: lowest-direct
3939
- python-version: "3.12"
40-
pydantic-version: "v1"
40+
os: windows-latest
41+
uv-resolution: highest
42+
- python-version: "3.13"
43+
os: macos-latest
44+
uv-resolution: lowest-direct
4145
fail-fast: false
42-
runs-on: ubuntu-latest
46+
runs-on: ${{ matrix.os }}
47+
env:
48+
UV_PYTHON: ${{ matrix.python-version }}
49+
UV_RESOLUTION: ${{ matrix.uv-resolution }}
4350
steps:
4451
- name: Dump GitHub context
4552
env:
@@ -62,22 +69,17 @@ jobs:
6269
with:
6370
limit-access-to-actor: true
6471
- name: Install Dependencies
65-
run: uv sync --locked --all-extras --dev
66-
- name: Install Pydantic v1
67-
if: matrix.pydantic-version == 'v1'
68-
run: uv pip install "pydantic<2.0.0"
69-
- name: Lint
70-
run: uv run --no-sync scripts/lint.sh
72+
run: uv sync --all-extras --dev
7173
- run: mkdir coverage
7274
- name: Test
73-
run: uv run --no-sync scripts/test.sh
75+
run: uv run --no-sync bash scripts/test.sh
7476
env:
7577
COVERAGE_FILE: coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }}
7678
CONTEXT: ${{ runner.os }}-py${{ matrix.python-version }}
7779
- name: Store coverage files
78-
uses: actions/upload-artifact@v4
80+
uses: actions/upload-artifact@v5
7981
with:
80-
name: coverage-${{ matrix.python-version }}-${{ matrix.pydantic-version }}
82+
name: coverage-${{ runner.os }}-${{ matrix.python-version }}
8183
path: coverage
8284
include-hidden-files: true
8385

@@ -96,23 +98,25 @@ jobs:
9698
# Issue ref: https://github.com/actions/setup-python/issues/436
9799
# cache: "pip"
98100
# cache-dependency-path: pyproject.toml
101+
- name: Install uv
102+
uses: astral-sh/setup-uv@v7
99103
- name: Get coverage files
100-
uses: actions/download-artifact@v5
104+
uses: actions/download-artifact@v6
101105
with:
102106
pattern: coverage-*
103107
path: coverage
104108
merge-multiple: true
105-
- run: pip install coverage[toml]
109+
- run: uv sync --locked --all-extras --dev
106110
- run: ls -la coverage
107-
- run: coverage combine coverage
108-
- run: coverage report
109-
- run: coverage html --title "Coverage for ${{ github.sha }}"
111+
- run: uv run coverage combine coverage
112+
- run: uv run coverage html --title "Coverage for ${{ github.sha }}"
110113
- name: Store coverage HTML
111-
uses: actions/upload-artifact@v4
114+
uses: actions/upload-artifact@v5
112115
with:
113116
name: coverage-html
114117
path: htmlcov
115118
include-hidden-files: true
119+
- run: uv run coverage report --fail-under=100
116120

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

.pre-commit-config.yaml

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# See https://pre-commit.com for more information
22
# See https://pre-commit.com/hooks.html for more hooks
3-
default_language_version:
4-
python: python3.10
53
repos:
64
- repo: https://github.com/pre-commit/pre-commit-hooks
75
rev: v4.6.0
@@ -13,13 +11,25 @@ repos:
1311
- --unsafe
1412
- id: end-of-file-fixer
1513
- id: trailing-whitespace
16-
- repo: https://github.com/astral-sh/ruff-pre-commit
17-
rev: v0.12.0
14+
- repo: local
1815
hooks:
19-
- id: ruff
20-
args:
21-
- --fix
22-
- id: ruff-format
23-
ci:
24-
autofix_commit_msg: 🎨 [pre-commit.ci] Auto format from pre-commit.com hooks
25-
autoupdate_commit_msg: ⬆ [pre-commit.ci] pre-commit autoupdate
16+
- id: local-ruff-check
17+
name: ruff check
18+
entry: uv run ruff check --force-exclude --fix --exit-non-zero-on-fix
19+
require_serial: true
20+
language: unsupported
21+
types: [python]
22+
23+
- id: local-ruff-format
24+
name: ruff format
25+
entry: uv run ruff format --force-exclude --exit-non-zero-on-format
26+
require_serial: true
27+
language: unsupported
28+
types: [python]
29+
30+
- id: local-mypy
31+
name: mypy check
32+
entry: uv run mypy src tests
33+
require_serial: true
34+
language: unsupported
35+
pass_filenames: false

.python-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.8
1+
3.10

pyproject.toml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "fastapi-cloud-cli"
33
dynamic = ["version"]
44
description = "Deploy and manage FastAPI Cloud apps from the command line 🚀"
55
authors = [{ name = "Patrick Arminio", email = "patrick@fastapilabs.com" }]
6-
requires-python = ">=3.8"
6+
requires-python = ">=3.10"
77
readme = "README.md"
88
license = { text = "MIT" }
99
classifiers = [
@@ -22,20 +22,20 @@ classifiers = [
2222
"Intended Audience :: Developers",
2323
"License :: OSI Approved :: MIT License",
2424
"Programming Language :: Python :: 3 :: Only",
25-
"Programming Language :: Python :: 3.8",
26-
"Programming Language :: Python :: 3.9",
2725
"Programming Language :: Python :: 3.10",
2826
"Programming Language :: Python :: 3.11",
2927
"Programming Language :: Python :: 3.12",
3028
"Programming Language :: Python :: 3.13",
3129
]
3230
dependencies = [
33-
"typer >= 0.12.3",
34-
"uvicorn[standard] >= 0.15.0",
31+
"typer >= 0.16.0",
32+
"uvicorn[standard] >= 0.17.6",
3533
"rignore >= 0.5.1",
3634
"httpx >= 0.27.0",
37-
"rich-toolkit >= 0.14.5",
38-
"pydantic[email] >= 1.6.1",
35+
"rich-toolkit >= 0.19.7",
36+
"pydantic[email] >= 2.7.4; python_version < '3.13'",
37+
"pydantic[email] >= 2.8.0; python_version == '3.13'",
38+
"pydantic[email] >= 2.12.0; python_version >= '3.14'",
3939
"sentry-sdk >= 2.20.0",
4040
"fastar >= 0.8.0",
4141
]
@@ -45,9 +45,9 @@ standard = ["uvicorn[standard] >= 0.15.0"]
4545

4646
[dependency-groups]
4747
dev = [
48-
"pre-commit>=2.17.0,<5.0.0",
49-
"pytest>=4.4.0,<9.0.0",
50-
"coverage[toml]>=6.2,<8.0",
48+
"prek>=0.2.24,<1.0.0",
49+
"pytest>=7.0.0,<9.0.0",
50+
"coverage[toml]>=7.2,<8.0",
5151
"mypy==1.14.1",
5252
"ruff==0.13.0",
5353
"respx==0.22.0",
@@ -81,6 +81,7 @@ junit_family = "xunit2"
8181
parallel = true
8282
data_file = "coverage/.coverage"
8383
source = ["src", "tests"]
84+
relative_files = true
8485
context = '${CONTEXT}'
8586
dynamic_context = "test_function"
8687
omit = ["tests/assets/*"]

0 commit comments

Comments
 (0)