Skip to content

Commit 7bafd24

Browse files
committed
ci: update workflows for the uv workspace + cli
1 parent 98961d5 commit 7bafd24

9 files changed

Lines changed: 67 additions & 74 deletions

File tree

.github/workflows/linting.yml

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,23 @@ on: [push, pull_request]
55
jobs:
66
lint:
77
runs-on: ubuntu-latest
8-
defaults:
9-
run:
10-
working-directory: backend
118
steps:
12-
- uses: actions/checkout@v4
13-
14-
- name: Set up Python
15-
uses: actions/setup-python@v5
16-
with:
17-
python-version: 3.11
9+
- uses: actions/checkout@v4
1810

19-
- name: Install uv
20-
run: pip install uv
11+
- name: Set up Python
12+
uses: actions/setup-python@v5
13+
with:
14+
python-version: '3.11'
2115

22-
- name: Create venv
23-
run: uv venv
16+
- name: Install uv
17+
run: pip install uv
2418

25-
- name: Install package with dev dependencies
26-
run: uv pip install -e ".[dev]"
19+
- name: Sync workspace
20+
# --all-packages is required to include extras from workspace members
21+
# (backend's dev extra holds ruff itself).
22+
run: uv sync --all-packages --all-extras
2723

28-
- name: Run Ruff
29-
run: uv run ruff check src
24+
- name: Ruff check (backend + cli)
25+
# --no-sync prevents uv run's implicit re-sync from dropping member
26+
# extras (it defaults to no extras and would remove ruff).
27+
run: uv run --no-sync ruff check backend/src cli/src

.github/workflows/tests.yml

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,25 @@ on: [push, pull_request]
55
jobs:
66
tests:
77
runs-on: ubuntu-latest
8-
defaults:
9-
run:
10-
working-directory: backend
11-
128
steps:
13-
- uses: actions/checkout@v4
14-
15-
- name: Set up Python
16-
uses: actions/setup-python@v5
17-
with:
18-
python-version: 3.11
19-
20-
- name: Install uv
21-
run: pip install uv
22-
23-
- name: Create venv
24-
run: uv venv
25-
26-
- name: Install package with dev dependencies
27-
run: uv pip install -e ".[dev]"
28-
29-
- name: Run tests
30-
run: uv run pytest
31-
env:
32-
ENVIRONMENT: local
33-
SECRET_KEY: test-secret-key-for-testing-only
9+
- uses: actions/checkout@v4
10+
11+
- name: Set up Python
12+
uses: actions/setup-python@v5
13+
with:
14+
python-version: '3.11'
15+
16+
- name: Install uv
17+
run: pip install uv
18+
19+
- name: Sync workspace
20+
run: uv sync --all-packages --all-extras
21+
22+
# Tests live in backend/ today; cli/ has no tests yet.
23+
- name: Pytest (backend)
24+
# --no-sync prevents uv run's implicit re-sync from dropping member
25+
# extras (it defaults to no extras and would remove pytest).
26+
run: cd backend && uv run --no-sync pytest
27+
env:
28+
ENVIRONMENT: local
29+
SECRET_KEY: test-secret-key-for-testing-only

.github/workflows/type-checking.yml

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,28 @@ on: [push, pull_request]
55
jobs:
66
type-check:
77
runs-on: ubuntu-latest
8-
defaults:
9-
run:
10-
working-directory: backend
11-
128
steps:
13-
- uses: actions/checkout@v4
14-
15-
- name: Set up Python
16-
uses: actions/setup-python@v5
17-
with:
18-
python-version: 3.11
19-
20-
- name: Install uv
21-
run: pip install uv
22-
23-
- name: Create venv
24-
run: uv venv
25-
26-
- name: Install package with dev dependencies
27-
run: uv pip install -e ".[dev]"
28-
29-
- name: Run mypy
30-
run: uv run mypy src --config-file pyproject.toml
31-
env:
32-
ENVIRONMENT: local
33-
SECRET_KEY: test-secret-key-for-testing-only
9+
- uses: actions/checkout@v4
10+
11+
- name: Set up Python
12+
uses: actions/setup-python@v5
13+
with:
14+
python-version: "3.11"
15+
16+
- name: Install uv
17+
run: pip install uv
18+
19+
- name: Sync workspace
20+
run: uv sync --all-packages --all-extras
21+
22+
- name: Mypy (backend)
23+
run: cd backend && uv run --no-sync mypy src --config-file pyproject.toml
24+
env:
25+
ENVIRONMENT: local
26+
SECRET_KEY: test-secret-key-for-testing-only
27+
28+
- name: Mypy (cli)
29+
run: cd cli && uv run --no-sync mypy src/cli
30+
env:
31+
ENVIRONMENT: local
32+
SECRET_KEY: test-secret-key-for-testing-only

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ fastapi-boilerplate/
8686
```bash
8787
git clone https://github.com/<you>/FastAPI-boilerplate
8888
cd FastAPI-boilerplate
89-
uv sync --all-extras # one venv at the root, both members installed
89+
uv sync --all-packages --all-extras # one venv at the root, both members installed
9090
```
9191

9292
Generate a compose file for the deployment shape you want:

backend/src/infrastructure/cache/backends/redis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ async def ping(self) -> bool:
143143
True if the cache is available, False otherwise.
144144
"""
145145
try:
146-
result = await self.client.ping()
146+
result = await self.client.ping() # type: ignore[misc]
147147
return bool(result)
148148
except Exception:
149149
return False

backend/src/infrastructure/rate_limit/backends/redis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ async def ping(self) -> bool:
185185
True if the backend is available, False otherwise.
186186
"""
187187
try:
188-
result = await self.client.ping()
188+
result = await self.client.ping() # type: ignore[misc]
189189
return bool(result)
190190
except Exception as e:
191191
logger.error(f"Failed to ping Redis server: {e}")

backend/src/interfaces/admin/views/tiers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from ..mixins import DataclassModelMixin
1111

1212

13-
class TierAdmin(DataclassModelMixin, ModelView, model=Tier): # type: ignore[call-arg]
13+
class TierAdmin(DataclassModelMixin, ModelView, model=Tier):
1414
"""Admin view for Tier model."""
1515

1616
name = "Tier"

backend/src/interfaces/admin/views/users.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
OAUTH_PROVIDER_CHOICES = [("", "None")] + [(p.value, p.value.title()) for p in OAuthProvider]
1616

1717

18-
class UserAdmin(DataclassModelMixin, ModelView, model=User): # type: ignore[call-arg]
18+
class UserAdmin(DataclassModelMixin, ModelView, model=User):
1919
"""Admin view for User model with password hashing."""
2020

2121
name = "User"

docs/getting-started/installation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ For development on your host machine. You provide PostgreSQL and Redis yourself.
114114
2. **Install Python dependencies**:
115115
116116
```bash
117-
uv sync --all-extras
117+
uv sync --all-packages --all-extras
118118
```
119119
120120
This syncs the whole workspace — backend, CLI, and dev tools — into one `.venv/` at the repo root. From here on, `uv run <cmd>` works from any subdirectory.
@@ -186,7 +186,7 @@ For contributors and anyone modifying the boilerplate itself.
186186
2. **Install dev dependencies**:
187187
188188
```bash
189-
uv sync --all-extras
189+
uv sync --all-packages --all-extras
190190
```
191191
192192
3. **Set up pre-commit hooks** (from the repo root):

0 commit comments

Comments
 (0)