Skip to content

Commit 1f0853d

Browse files
committed
Merge branch 'main' into dependabot/pip/ruff-0.14.7
2 parents 0529d20 + 00ddec8 commit 1f0853d

45 files changed

Lines changed: 4864 additions & 772 deletions

Some content is hidden

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

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ updates:
99
prefix:
1010
labels: [dependencies, internal]
1111
# Python
12-
- package-ecosystem: "pip"
12+
- package-ecosystem: "uv"
1313
directory: "/"
1414
schedule:
1515
interval: "daily"

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,20 @@ jobs:
1010
runs-on: ubuntu-latest
1111
permissions:
1212
id-token: write
13+
contents: read
1314
steps:
1415
- name: Dump GitHub context
1516
env:
1617
GITHUB_CONTEXT: ${{ toJson(github) }}
1718
run: echo "$GITHUB_CONTEXT"
1819
- uses: actions/checkout@v5
1920
- name: Set up Python
20-
uses: actions/setup-python@v5
21+
uses: actions/setup-python@v6
2122
with:
22-
python-version: "3.10"
23-
- name: Install build dependencies
24-
run: pip install build
23+
python-version-file: "pyproject.toml"
24+
- name: Install uv
25+
uses: astral-sh/setup-uv@v7
2526
- name: Build distribution
26-
run: python -m build
27+
run: uv build
2728
- name: Publish
28-
uses: pypa/gh-action-pypi-publish@v1.13.0
29+
run: uv publish

.github/workflows/smokeshow.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,16 @@ 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

.github/workflows/test-redistribute.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ jobs:
1919
run: echo "$GITHUB_CONTEXT"
2020
- uses: actions/checkout@v5
2121
- name: Set up Python
22-
uses: actions/setup-python@v5
22+
uses: actions/setup-python@v6
2323
with:
24-
python-version: "3.10"
24+
python-version-file: "pyproject.toml"
2525
# Issue ref: https://github.com/actions/setup-python/issues/436
2626
# cache: "pip"
2727
# cache-dependency-path: pyproject.toml
@@ -36,9 +36,7 @@ jobs:
3636
- name: Install test dependencies
3737
run: |
3838
cd dist/fastapi_cloud_cli*/
39-
pip install -r requirements-tests.txt
40-
env:
41-
TIANGOLO_BUILD_PACKAGE: ${{ matrix.package }}
39+
pip install --group dev .
4240
- name: Run source distribution tests
4341
run: |
4442
cd dist/fastapi_cloud_cli*/

.github/workflows/test.yml

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -25,63 +25,61 @@ 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:
4653
GITHUB_CONTEXT: ${{ toJson(github) }}
4754
run: echo "$GITHUB_CONTEXT"
4855
- uses: actions/checkout@v5
4956
- name: Set up Python
50-
uses: actions/setup-python@v5
57+
uses: actions/setup-python@v6
5158
with:
5259
python-version: ${{ matrix.python-version }}
5360
# Issue ref: https://github.com/actions/setup-python/issues/436
5461
# cache: "pip"
5562
# cache-dependency-path: pyproject.toml
56-
- uses: actions/cache@v4
57-
id: cache
58-
with:
59-
path: ${{ env.pythonLocation }}
60-
key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml', 'requirements-tests.txt') }}-{{ matrix.pydantic-version }}
63+
- name: Install uv
64+
uses: astral-sh/setup-uv@v7
6165
# Allow debugging with tmate
6266
- name: Setup tmate session
6367
uses: mxschmitt/action-tmate@v3
6468
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled == 'true' }}
6569
with:
6670
limit-access-to-actor: true
6771
- name: Install Dependencies
68-
if: steps.cache.outputs.cache-hit != 'true'
69-
run: pip install -r requirements-tests.txt
70-
- name: Install Pydantic v1
71-
if: matrix.pydantic-version == 'v1'
72-
run: pip install "pydantic<2.0.0"
73-
- name: Lint
74-
run: bash scripts/lint.sh
72+
run: uv sync --all-extras --dev
7573
- run: mkdir coverage
7674
- name: Test
77-
run: bash scripts/test.sh
75+
run: uv run --no-sync bash scripts/test.sh
7876
env:
7977
COVERAGE_FILE: coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }}
8078
CONTEXT: ${{ runner.os }}-py${{ matrix.python-version }}
8179
- name: Store coverage files
82-
uses: actions/upload-artifact@v4
80+
uses: actions/upload-artifact@v5
8381
with:
84-
name: coverage-${{ matrix.python-version }}-${{ matrix.pydantic-version }}
82+
name: coverage-${{ runner.os }}-${{ matrix.python-version }}
8583
path: coverage
8684
include-hidden-files: true
8785

@@ -94,29 +92,31 @@ jobs:
9492
GITHUB_CONTEXT: ${{ toJson(github) }}
9593
run: echo "$GITHUB_CONTEXT"
9694
- uses: actions/checkout@v5
97-
- uses: actions/setup-python@v5
95+
- uses: actions/setup-python@v6
9896
with:
99-
python-version: '3.8'
97+
python-version-file: "pyproject.toml"
10098
# Issue ref: https://github.com/actions/setup-python/issues/436
10199
# cache: "pip"
102100
# cache-dependency-path: pyproject.toml
101+
- name: Install uv
102+
uses: astral-sh/setup-uv@v7
103103
- name: Get coverage files
104104
uses: actions/download-artifact@v5
105105
with:
106106
pattern: coverage-*
107107
path: coverage
108108
merge-multiple: true
109-
- run: pip install coverage[toml]
109+
- run: uv sync --locked --all-extras --dev
110110
- run: ls -la coverage
111-
- run: coverage combine coverage
112-
- run: coverage report
113-
- 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 }}"
114113
- name: Store coverage HTML
115-
uses: actions/upload-artifact@v4
114+
uses: actions/upload-artifact@v5
116115
with:
117116
name: coverage-html
118117
path: htmlcov
119118
include-hidden-files: true
119+
- run: uv run coverage report --fail-under=100
120120

121121
# https://github.com/marketplace/actions/alls-green#why
122122
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 & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.10

0 commit comments

Comments
 (0)