Skip to content

Commit 680b87b

Browse files
Merge branch 'main' into logs_command
2 parents a422116 + e79be2b commit 680b87b

22 files changed

Lines changed: 342 additions & 1286 deletions

.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: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ permissions:
1010

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

1615
steps:
@@ -20,7 +19,7 @@ jobs:
2019
run: echo "$GITHUB_CONTEXT"
2120
- uses: actions/setup-python@v5
2221
with:
23-
python-version: '3.9'
22+
python-version: '3.13'
2423

2524
- run: pip install smokeshow
2625

.github/workflows/test.yml

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,11 @@ 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"]
30-
include:
31-
- python-version: "3.8"
32-
pydantic-version: "v1"
33-
- python-version: "3.9"
34-
pydantic-version: "v1"
35-
- python-version: "3.10"
36-
pydantic-version: "v1"
37-
- python-version: "3.11"
38-
pydantic-version: "v1"
39-
- python-version: "3.12"
40-
pydantic-version: "v1"
28+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
4129
fail-fast: false
4230
runs-on: ubuntu-latest
31+
env:
32+
UV_PYTHON: ${{ matrix.python-version }}
4333
steps:
4434
- name: Dump GitHub context
4535
env:
@@ -63,11 +53,6 @@ jobs:
6353
limit-access-to-actor: true
6454
- name: Install Dependencies
6555
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
7156
- run: mkdir coverage
7257
- name: Test
7358
run: uv run --no-sync scripts/test.sh
@@ -77,7 +62,7 @@ jobs:
7762
- name: Store coverage files
7863
uses: actions/upload-artifact@v4
7964
with:
80-
name: coverage-${{ matrix.python-version }}-${{ matrix.pydantic-version }}
65+
name: coverage-${{ matrix.python-version }}
8166
path: coverage
8267
include-hidden-files: true
8368

@@ -107,14 +92,14 @@ jobs:
10792
- run: uv sync --locked --all-extras --dev
10893
- run: ls -la coverage
10994
- run: uv run coverage combine coverage
110-
- run: uv run coverage report
11195
- run: uv run coverage html --title "Coverage for ${{ github.sha }}"
11296
- name: Store coverage HTML
11397
uses: actions/upload-artifact@v4
11498
with:
11599
name: coverage-html
116100
path: htmlcov
117101
include-hidden-files: true
102+
- run: uv run coverage report --fail-under=100
118103

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

.pre-commit-config.yaml

Lines changed: 14 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,18 @@ 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]

.python-version

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

pyproject.toml

Lines changed: 3 additions & 4 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.9"
77
readme = "README.md"
88
license = { text = "MIT" }
99
classifiers = [
@@ -22,7 +22,6 @@ classifiers = [
2222
"Intended Audience :: Developers",
2323
"License :: OSI Approved :: MIT License",
2424
"Programming Language :: Python :: 3 :: Only",
25-
"Programming Language :: Python :: 3.8",
2625
"Programming Language :: Python :: 3.9",
2726
"Programming Language :: Python :: 3.10",
2827
"Programming Language :: Python :: 3.11",
@@ -35,7 +34,7 @@ dependencies = [
3534
"rignore >= 0.5.1",
3635
"httpx >= 0.27.0",
3736
"rich-toolkit >= 0.14.5",
38-
"pydantic[email] >= 1.6.1",
37+
"pydantic[email] >= 2.0",
3938
"sentry-sdk >= 2.20.0",
4039
"fastar >= 0.8.0",
4140
]
@@ -45,7 +44,7 @@ standard = ["uvicorn[standard] >= 0.15.0"]
4544

4645
[dependency-groups]
4746
dev = [
48-
"pre-commit>=2.17.0,<5.0.0",
47+
"prek>=0.2.24,<1.0.0",
4948
"pytest>=4.4.0,<9.0.0",
5049
"coverage[toml]>=6.2,<8.0",
5150
"mypy==1.14.1",

release-notes.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,30 @@
22

33
## Latest Changes
44

5+
### Internal
6+
7+
* 👷 Add pre-commit workflow. PR [#135](https://github.com/fastapilabs/fastapi-cloud-cli/pull/135) by [@YuriiMotov](https://github.com/YuriiMotov).
8+
9+
## 0.8.0
10+
11+
### Fixes
12+
13+
* 🐛 Fix CI ran all tests on oldest supported Python. PR [#136](https://github.com/fastapilabs/fastapi-cloud-cli/pull/136) by [@DoctorJohn](https://github.com/DoctorJohn).
14+
15+
### Refactors
16+
17+
* ♻️ Reorder log messages for deployment readiness. PR [#137](https://github.com/fastapilabs/fastapi-cloud-cli/pull/137) by [@alejsdev](https://github.com/alejsdev).
18+
19+
### Upgrades
20+
21+
* ➖ Drop support for Pydantic v1. PR [#139](https://github.com/fastapilabs/fastapi-cloud-cli/pull/139) by [@patrick91](https://github.com/patrick91).
22+
* 🔧 Drop support for Python 3.8. PR [#138](https://github.com/fastapilabs/fastapi-cloud-cli/pull/138) by [@patrick91](https://github.com/patrick91).
23+
24+
### Internal
25+
26+
* 👷 Configure coverage, error on main tests, don't wait for Smokeshow. PR [#134](https://github.com/fastapilabs/fastapi-cloud-cli/pull/134) by [@YuriiMotov](https://github.com/YuriiMotov).
27+
* 👷 Run Smokeshow always, even on test failures. PR [#133](https://github.com/fastapilabs/fastapi-cloud-cli/pull/133) by [@YuriiMotov](https://github.com/YuriiMotov).
28+
529
## 0.7.0
630

731
### Features

src/fastapi_cloud_cli/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.7.0"
1+
__version__ = "0.8.0"

0 commit comments

Comments
 (0)