Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ updates:
prefix: ⬆
labels: [dependencies, internal]
# Python
- package-ecosystem: "pip"
- package-ecosystem: "uv"
directory: "/"
schedule:
interval: "daily"
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,20 @@ jobs:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: "3.10"
- name: Install build dependencies
run: pip install build
python-version-file: "pyproject.toml"
Comment thread
DoctorJohn marked this conversation as resolved.
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Build distribution
run: python -m build
run: uv build
- name: Publish
uses: pypa/gh-action-pypi-publish@v1.13.0
run: uv publish
Comment thread
DoctorJohn marked this conversation as resolved.
14 changes: 6 additions & 8 deletions .github/workflows/test-redistribute.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,24 @@ jobs:
run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: "3.10"
python-version-file: "pyproject.toml"
# Issue ref: https://github.com/actions/setup-python/issues/436
# cache: "pip"
# cache-dependency-path: pyproject.toml
- name: Install build dependencies
run: pip install build
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Build source distribution
run: python -m build --sdist
run: uv build --sdist
Comment thread
DoctorJohn marked this conversation as resolved.
Outdated
- name: Decompress source distribution
run: |
cd dist
tar xvf fastapi_cloud_cli*.tar.gz
- name: Install test dependencies
run: |
cd dist/fastapi_cloud_cli*/
pip install -r requirements-tests.txt
env:
TIANGOLO_BUILD_PACKAGE: ${{ matrix.package }}
pip install --group dev .
Comment thread
DoctorJohn marked this conversation as resolved.
- name: Run source distribution tests
run: |
cd dist/fastapi_cloud_cli*/
Expand Down
21 changes: 10 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,35 +47,34 @@ jobs:
run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
# Issue ref: https://github.com/actions/setup-python/issues/436
# cache: "pip"
# cache-dependency-path: pyproject.toml
- uses: actions/cache@v4
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml', 'requirements-tests.txt') }}-{{ matrix.pydantic-version }}
- name: Install uv
uses: astral-sh/setup-uv@v7
# Allow debugging with tmate
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled == 'true' }}
with:
limit-access-to-actor: true
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install -r requirements-tests.txt
run: uv sync --locked --all-extras --dev
- name: Install Pydantic v1
if: matrix.pydantic-version == 'v1'
run: pip install "pydantic<2.0.0"
run: uv pip install "pydantic<2.0.0"
- name: Lint
run: bash scripts/lint.sh
env:
UV_NO_SYNC: "1"
- run: mkdir coverage
- name: Test
run: bash scripts/test.sh
env:
UV_NO_SYNC: "1"
COVERAGE_FILE: coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }}
CONTEXT: ${{ runner.os }}-py${{ matrix.python-version }}
- name: Store coverage files
Expand All @@ -94,9 +93,9 @@ jobs:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v5
- uses: actions/setup-python@v5
- uses: actions/setup-python@v6
with:
python-version: '3.8'
python-version-file: "pyproject.toml"
# Issue ref: https://github.com/actions/setup-python/issues/436
# cache: "pip"
# cache-dependency-path: pyproject.toml
Expand Down
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.8
30 changes: 16 additions & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "fastapi-cloud-cli"
dynamic = ["version"]
version = "0.5.2"
description = "Deploy and manage FastAPI Cloud apps from the command line 🚀"
authors = [{ name = "Patrick Arminio", email = "patrick@fastapilabs.com" }]
requires-python = ">=3.8"
Expand Down Expand Up @@ -28,7 +28,6 @@ classifiers = [
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"License :: OSI Approved :: MIT License",
]
dependencies = [
"typer >= 0.12.3",
Expand All @@ -44,6 +43,17 @@ dependencies = [
[project.optional-dependencies]
standard = ["uvicorn[standard] >= 0.15.0"]

[dependency-groups]
dev = [
"pre-commit>=2.17.0,<5.0.0",
"pytest>=4.4.0,<9.0.0",
"coverage[toml]>=6.2,<8.0",
"mypy==1.14.1",
"ruff==0.13.0",
"respx==0.22.0",
"time-machine==2.15.0",
]

[project.urls]
Homepage = "https://github.com/fastapilabs/fastapi-cloud-cli"
Documentation = "https://fastapi.tiangolo.com/fastapi-cloud-cli/"
Expand All @@ -52,15 +62,11 @@ Issues = "https://github.com/fastapilabs/fastapi-cloud-cli/issues"
Changelog = "https://github.com/fastapilabs/fastapi-cloud-cli/blob/main/release-notes.md"

[build-system]
requires = ["pdm-backend"]
build-backend = "pdm.backend"
requires = ["uv_build>=0.9.13,<0.10.0"]
build-backend = "uv_build"
Comment thread
tiangolo marked this conversation as resolved.
Outdated

[tool.pdm]
version = { source = "file", path = "src/fastapi_cloud_cli/__init__.py" }
distribution = true

[tool.pdm.build]
source-includes = ["tests/", "requirements*.txt", "scripts/"]
[tool.uv.build-backend]
source-include = ["tests/**", "scripts/**"]

[tool.pytest.ini_options]
addopts = ["--strict-config", "--strict-markers"]
Expand Down Expand Up @@ -109,10 +115,6 @@ ignore = [
"W191", # indentation contains tabs
]

# [tool.ruff.lint.per-file-ignores]
# "__init__.py" = ["F401"]


[tool.ruff.lint.isort]
known-third-party = ["typer", "fastapi"]

Expand Down
8 changes: 0 additions & 8 deletions requirements-tests.txt

This file was deleted.

5 changes: 0 additions & 5 deletions requirements.txt

This file was deleted.

6 changes: 3 additions & 3 deletions scripts/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
set -e
set -x

mypy src tests
ruff check src tests scripts
ruff format src tests --check
uv run mypy src tests
uv run ruff check src tests scripts
uv run ruff format src tests --check
2 changes: 1 addition & 1 deletion scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
set -e
set -x

coverage run -m pytest tests ${@}
uv run coverage run -m pytest tests ${@}
4 changes: 3 additions & 1 deletion src/fastapi_cloud_cli/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
__version__ = "0.5.2"
from importlib import metadata

__version__ = metadata.version("fastapi-cloud-cli")
Comment thread
tiangolo marked this conversation as resolved.
Outdated
Loading