Skip to content

Commit aa10ed0

Browse files
authored
Merge pull request #7 from fsecada01/001-optional-deps
feat(deps): make FastAPI/Uvicorn/JinjaX optional extras (0.3.0b0)
2 parents ad41fa4 + e33c320 commit aa10ed0

26 files changed

Lines changed: 758 additions & 35 deletions

.github/workflows/ci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
with:
1616
python-version: "3.12"
1717
- name: Install dependencies
18-
run: pip install -e ".[dev,django,websockets]"
18+
run: pip install -e ".[dev]"
1919
- name: Check formatting
2020
run: ruff format --check .
2121
- name: Lint
@@ -26,6 +26,7 @@ jobs:
2626
test:
2727
runs-on: ubuntu-latest
2828
strategy:
29+
fail-fast: false
2930
matrix:
3031
python-version: ["3.11", "3.12", "3.13", "3.14"]
3132
steps:
@@ -34,6 +35,6 @@ jobs:
3435
with:
3536
python-version: ${{ matrix.python-version }}
3637
- name: Install dependencies
37-
run: pip install -e ".[dev,django,websockets]"
38+
run: pip install -e ".[dev]"
3839
- name: Run tests
3940
run: pytest tests/ -q --tb=short

CHANGELOG.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [0.3.0b0] - 2026-02-23
9+
10+
### Breaking Changes
11+
12+
- **`fastapi`, `uvicorn`, and `jinjax` are no longer installed by default.**
13+
These packages have been moved from mandatory core dependencies to the optional
14+
`[fastapi]` extras group. Existing FastAPI users must update their install command:
15+
16+
```bash
17+
# Before (0.2.x)
18+
pip install component-framework
19+
20+
# After (0.3.0+)
21+
pip install "component-framework[fastapi]"
22+
```
23+
24+
**CI pipelines** that install the bare package without specifying an extras group
25+
will break silently after this upgrade. Update all install commands in CI
26+
configuration files (GitHub Actions, Dockerfile, tox.ini, Makefile, etc.).
27+
28+
**Transitive dependents** — downstream projects that relied on `fastapi` or
29+
`jinjax` being pulled in transitively through this library will also be affected.
30+
Audit your dependency tree if you see unexpected ImportError messages after upgrading.
31+
32+
### Added
33+
34+
- `[fastapi]` optional extras group — installs `fastapi>=0.109.0`,
35+
`uvicorn[standard]>=0.27.0`, and `jinjax>=0.41`.
36+
- `[dev-base]` optional extras group — test tooling without adapter extras,
37+
used by the CI isolation matrix.
38+
- `[all]` convenience extras group — installs all runtime extras
39+
(`[fastapi,django,websockets]`).
40+
- Actionable `ImportError` messages on all adapter modules — attempting to import
41+
an adapter without its extras group now raises a clear error naming the missing
42+
package and the install command needed to resolve it. Example:
43+
44+
```
45+
ImportError: 'fastapi' is not installed.
46+
Install the 'fastapi' extra: pip install 'component-framework[fastapi]'
47+
```
48+
49+
- CI extras isolation matrix — each extras group (`base`, `fastapi`, `django`,
50+
`all`) is now tested in isolation to prevent cross-adapter contamination.
51+
- `pytest.importorskip` guards on all adapter test modules — adapter tests skip
52+
cleanly instead of failing with `ImportError` when the relevant extras group is
53+
not installed.
54+
55+
### Changed
56+
57+
- `[dev]` extras group now self-references all runtime extras via
58+
`component-framework[dev-base,fastapi,django,websockets]`. Installing `.[dev]`
59+
continues to provide the full development environment.
60+
- `pydantic>=2.0` is now the only mandatory runtime dependency.
61+
62+
## [0.2.0b0] - 2025-XX-XX
63+
64+
Initial Beta release. See README for full feature list.

README.md

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,66 @@ Framework-agnostic server components with LiveView-style interactivity inspired
1414

1515
## Development Status
1616

17-
**Current Version:** 0.2.0-beta
17+
**Current Version:** 0.3.0-beta
1818
**API Documentation:** [fsecada01.github.io/component-framework](https://fsecada01.github.io/component-framework/)
1919

2020
The framework has a complete, tested feature set covering the full Beta roadmap. APIs are solidifying — the core lifecycle, permissions, composition, and testing utilities are stable. We welcome feedback before the 1.0 release.
2121

2222
---
2323

24+
## Adapter Support
25+
26+
| Framework | Status | Install extra | Notes |
27+
|-----------|--------|---------------|-------|
28+
| **FastAPI** | ✅ Supported | `[fastapi]` | Includes JinjaX renderer and WebSocket adapter |
29+
| **Django** | ✅ Supported | `[django]` | Includes Channels, Cotton, and template renderer |
30+
| **Flask** | 🗓 Planned || [Tracking issue #5](https://github.com/fsecada01/component-framework/issues/5) |
31+
| **Litestar** | 🗓 Planned || [Tracking issue #6](https://github.com/fsecada01/component-framework/issues/6) |
32+
33+
---
34+
35+
## Installation
36+
37+
Install only what you need — `pydantic` is the only mandatory dependency:
38+
39+
```bash
40+
# Django projects
41+
pip install "component-framework[django]"
42+
43+
# FastAPI projects
44+
pip install "component-framework[fastapi]"
45+
46+
# Both adapters
47+
pip install "component-framework[fastapi,django]"
48+
49+
# Everything
50+
pip install "component-framework[all]"
51+
```
52+
53+
### Migrating from 0.2.x
54+
55+
> ⚠️ **Breaking change in 0.3.0**: `fastapi`, `uvicorn`, and `jinjax` are no longer
56+
> installed by default.
57+
58+
If you were using the FastAPI adapter, add `[fastapi]` to your install command:
59+
60+
```bash
61+
# Before
62+
pip install component-framework
63+
64+
# After
65+
pip install "component-framework[fastapi]"
66+
```
67+
68+
**CI pipelines** — any workflow step that installs `component-framework` without
69+
specifying an extras group will stop receiving FastAPI automatically. Update all
70+
install commands in your GitHub Actions, Dockerfile, tox.ini, Makefile, or other
71+
CI configuration files.
72+
73+
See [CHANGELOG.md](CHANGELOG.md) for the full list of changes.
74+
75+
---
76+
2477
## Features
2578

2679
### Core

pyproject.toml

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "component-framework"
3-
version = "0.2.0b0"
3+
version = "0.3.0b0"
44
description = "Framework-agnostic server components with LiveView-style interactivity"
55
readme = "README.md"
66
requires-python = ">=3.11"
@@ -20,22 +20,14 @@ classifiers = [
2020
]
2121

2222
dependencies = [
23-
"fastapi>=0.109.0",
24-
"uvicorn[standard]>=0.27.0",
25-
"jinjax>=0.41",
2623
"pydantic>=2.0",
2724
]
2825

2926
[project.optional-dependencies]
30-
dev = [
31-
"pytest>=7.4.0",
32-
"pytest-asyncio>=0.21.0",
33-
"pytest-django>=4.5.0",
34-
"httpx>=0.26.0",
35-
"ruff>=0.1.0",
36-
"ty>=0.0.18",
37-
"pre-commit>=3.5.0",
38-
"pdoc>=14.0",
27+
fastapi = [
28+
"fastapi>=0.109.0",
29+
"uvicorn[standard]>=0.27.0",
30+
"jinjax>=0.41",
3931
]
4032
django = [
4133
"django>=4.2",
@@ -46,6 +38,22 @@ django = [
4638
websockets = [
4739
"websockets>=12.0",
4840
]
41+
dev-base = [
42+
"pytest>=7.4.0",
43+
"pytest-asyncio>=0.21.0",
44+
"pytest-django>=4.5.0",
45+
"httpx>=0.26.0",
46+
"ruff>=0.1.0",
47+
"ty>=0.0.18",
48+
]
49+
dev = [
50+
"component-framework[dev-base,fastapi,django,websockets]",
51+
"pre-commit>=3.5.0",
52+
"pdoc>=14.0",
53+
]
54+
all = [
55+
"component-framework[fastapi,django,websockets]",
56+
]
4957

5058
[project.urls]
5159
Homepage = "https://github.com/fsecada01/component-framework"

0 commit comments

Comments
 (0)