pico-fastapi 0.2.3.dev0__tar.gz → 0.3.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pico_fastapi-0.3.1/.github/ISSUE_TEMPLATE/bug_report.yml +32 -0
- pico_fastapi-0.3.1/.github/ISSUE_TEMPLATE/feature_request.yml +18 -0
- pico_fastapi-0.3.1/.github/PULL_REQUEST_TEMPLATE.md +10 -0
- pico_fastapi-0.3.1/.github/dependabot.yml +10 -0
- pico_fastapi-0.3.1/.github/workflows/ci.yml +90 -0
- pico_fastapi-0.3.1/.github/workflows/codeql.yml +21 -0
- pico_fastapi-0.3.1/.github/workflows/docs.yml +48 -0
- pico_fastapi-0.3.1/.github/workflows/publish-to-pypi.yml +24 -0
- pico_fastapi-0.3.1/.sonarcloud.properties +3 -0
- {pico_fastapi-0.2.3.dev0 → pico_fastapi-0.3.1}/CHANGELOG.md +10 -3
- {pico_fastapi-0.2.3.dev0 → pico_fastapi-0.3.1}/CLAUDE.md +1 -1
- pico_fastapi-0.3.1/CODE_OF_CONDUCT.md +31 -0
- pico_fastapi-0.3.1/CONTRIBUTING.md +34 -0
- {pico_fastapi-0.2.3.dev0 → pico_fastapi-0.3.1}/PKG-INFO +40 -28
- {pico_fastapi-0.2.3.dev0 → pico_fastapi-0.3.1}/README.md +35 -27
- pico_fastapi-0.3.1/SECURITY.md +23 -0
- {pico_fastapi-0.2.3.dev0 → pico_fastapi-0.3.1}/docs/CHANGELOG.md +10 -3
- {pico_fastapi-0.2.3.dev0 → pico_fastapi-0.3.1}/docs/architecture.md +110 -3
- {pico_fastapi-0.2.3.dev0 → pico_fastapi-0.3.1}/docs/faq.md +110 -26
- {pico_fastapi-0.2.3.dev0 → pico_fastapi-0.3.1}/docs/getting-started.md +5 -12
- pico_fastapi-0.3.1/docs/hooks.py +24 -0
- pico_fastapi-0.3.1/docs/how-to/cors.md +140 -0
- {pico_fastapi-0.2.3.dev0 → pico_fastapi-0.3.1}/docs/how-to/index.md +5 -1
- pico_fastapi-0.3.1/docs/how-to/migrating-from-fastapi.md +422 -0
- pico_fastapi-0.3.1/docs/how-to/settings-applied.md +96 -0
- pico_fastapi-0.3.1/docs/how-to/testing.md +249 -0
- pico_fastapi-0.3.1/docs/how-to/websocket.md +159 -0
- {pico_fastapi-0.2.3.dev0 → pico_fastapi-0.3.1}/docs/index.md +10 -6
- pico_fastapi-0.3.1/docs/llms.txt +34 -0
- pico_fastapi-0.3.1/docs/migration.md +199 -0
- pico_fastapi-0.3.1/docs/reference/config.md +123 -0
- pico_fastapi-0.3.1/docs/reference/exceptions.md +80 -0
- {pico_fastapi-0.2.3.dev0 → pico_fastapi-0.3.1}/docs/reference/index.md +14 -32
- pico_fastapi-0.3.1/docs/requirements.txt +7 -0
- pico_fastapi-0.3.1/docs/skills.md +59 -0
- pico_fastapi-0.3.1/docs/troubleshooting.md +343 -0
- {pico_fastapi-0.2.3.dev0 → pico_fastapi-0.3.1}/docs/tutorial.md +16 -23
- {pico_fastapi-0.2.3.dev0 → pico_fastapi-0.3.1}/docs/user-guide/configurers.md +9 -9
- {pico_fastapi-0.2.3.dev0 → pico_fastapi-0.3.1}/docs/user-guide/index.md +2 -2
- pico_fastapi-0.3.1/examples/rest-api/README.md +33 -0
- pico_fastapi-0.3.1/examples/rest-api/application.yaml +6 -0
- pico_fastapi-0.3.1/examples/rest-api/myapp/config.py +9 -0
- pico_fastapi-0.3.1/examples/rest-api/myapp/controllers.py +23 -0
- pico_fastapi-0.3.1/examples/rest-api/myapp/main.py +22 -0
- pico_fastapi-0.3.1/examples/rest-api/myapp/services.py +22 -0
- pico_fastapi-0.3.1/examples/rest-api/requirements.txt +3 -0
- {pico_fastapi-0.2.3.dev0 → pico_fastapi-0.3.1}/mkdocs.yml +18 -2
- {pico_fastapi-0.2.3.dev0 → pico_fastapi-0.3.1}/pyproject.toml +27 -1
- pico_fastapi-0.3.1/src/pico_fastapi/__init__.py +33 -0
- pico_fastapi-0.3.1/src/pico_fastapi/_version.py +1 -0
- pico_fastapi-0.3.1/src/pico_fastapi/config.py +95 -0
- pico_fastapi-0.3.1/src/pico_fastapi/decorators.py +238 -0
- pico_fastapi-0.3.1/src/pico_fastapi/exceptions.py +52 -0
- pico_fastapi-0.3.1/src/pico_fastapi/factory.py +419 -0
- pico_fastapi-0.3.1/src/pico_fastapi/middleware.py +131 -0
- pico_fastapi-0.3.1/src/pico_fastapi/py.typed +0 -0
- {pico_fastapi-0.2.3.dev0 → pico_fastapi-0.3.1}/src/pico_fastapi.egg-info/PKG-INFO +40 -28
- {pico_fastapi-0.2.3.dev0 → pico_fastapi-0.3.1}/src/pico_fastapi.egg-info/SOURCES.txt +30 -1
- pico_fastapi-0.3.1/src/pico_fastapi.egg-info/scm_file_list.json +87 -0
- pico_fastapi-0.3.1/src/pico_fastapi.egg-info/scm_version.json +8 -0
- pico_fastapi-0.3.1/tests/__init__.py +0 -0
- {pico_fastapi-0.2.3.dev0 → pico_fastapi-0.3.1}/tests/conftest.py +57 -31
- {pico_fastapi-0.2.3.dev0 → pico_fastapi-0.3.1}/tests/test_config.py +18 -8
- {pico_fastapi-0.2.3.dev0 → pico_fastapi-0.3.1}/tests/test_configurer_priority.py +21 -32
- pico_fastapi-0.3.1/tests/test_coverage_boost_v2.py +134 -0
- {pico_fastapi-0.2.3.dev0 → pico_fastapi-0.3.1}/tests/test_decorators.py +27 -5
- {pico_fastapi-0.2.3.dev0 → pico_fastapi-0.3.1}/tests/test_exceptions.py +4 -2
- {pico_fastapi-0.2.3.dev0 → pico_fastapi-0.3.1}/tests/test_exports.py +11 -3
- {pico_fastapi-0.2.3.dev0 → pico_fastapi-0.3.1}/tests/test_factory.py +56 -28
- {pico_fastapi-0.2.3.dev0 → pico_fastapi-0.3.1}/tests/test_http_admin.py +2 -0
- pico_fastapi-0.3.1/tests/test_marker_propagation.py +39 -0
- {pico_fastapi-0.2.3.dev0 → pico_fastapi-0.3.1}/tests/test_middleware.py +5 -1
- {pico_fastapi-0.2.3.dev0 → pico_fastapi-0.3.1}/tests/test_settings_applied.py +1 -0
- {pico_fastapi-0.2.3.dev0 → pico_fastapi-0.3.1}/tests/test_websocket_chat.py +0 -1
- pico_fastapi-0.2.3.dev0/.github/workflows/ci.yml +0 -102
- pico_fastapi-0.2.3.dev0/.github/workflows/docs.yml +0 -104
- pico_fastapi-0.2.3.dev0/.github/workflows/publish-to-pypi.yml +0 -36
- pico_fastapi-0.2.3.dev0/docs/how-to/settings-applied.md +0 -127
- pico_fastapi-0.2.3.dev0/docs/reference/config.md +0 -172
- pico_fastapi-0.2.3.dev0/docs/reference/exceptions.md +0 -122
- pico_fastapi-0.2.3.dev0/docs/requirements.txt +0 -6
- pico_fastapi-0.2.3.dev0/docs/skills.md +0 -108
- pico_fastapi-0.2.3.dev0/manage.sh +0 -65
- pico_fastapi-0.2.3.dev0/src/pico_fastapi/__init__.py +0 -19
- pico_fastapi-0.2.3.dev0/src/pico_fastapi/_version.py +0 -1
- pico_fastapi-0.2.3.dev0/src/pico_fastapi/config.py +0 -18
- pico_fastapi-0.2.3.dev0/src/pico_fastapi/decorators.py +0 -46
- pico_fastapi-0.2.3.dev0/src/pico_fastapi/exceptions.py +0 -6
- pico_fastapi-0.2.3.dev0/src/pico_fastapi/factory.py +0 -200
- pico_fastapi-0.2.3.dev0/src/pico_fastapi/middleware.py +0 -56
- {pico_fastapi-0.2.3.dev0 → pico_fastapi-0.3.1}/.coveragerc +0 -0
- {pico_fastapi-0.2.3.dev0 → pico_fastapi-0.3.1}/AGENTS.md +0 -0
- {pico_fastapi-0.2.3.dev0 → pico_fastapi-0.3.1}/LICENSE +0 -0
- {pico_fastapi-0.2.3.dev0 → pico_fastapi-0.3.1}/MANIFEST.in +0 -0
- {pico_fastapi-0.2.3.dev0 → pico_fastapi-0.3.1}/docs/explanation/test-suite.md +0 -0
- {pico_fastapi-0.2.3.dev0 → pico_fastapi-0.3.1}/docs/how-to/session-cart.md +0 -0
- {pico_fastapi-0.2.3.dev0 → pico_fastapi-0.3.1}/docs/how-to/websocket-chat.md +0 -0
- {pico_fastapi-0.2.3.dev0 → pico_fastapi-0.3.1}/docs/javascripts/extra.js +0 -0
- {pico_fastapi-0.2.3.dev0 → pico_fastapi-0.3.1}/docs/stylesheets/extra.css +0 -0
- {pico_fastapi-0.2.3.dev0/tests → pico_fastapi-0.3.1/examples/rest-api/myapp}/__init__.py +0 -0
- {pico_fastapi-0.2.3.dev0 → pico_fastapi-0.3.1}/setup.cfg +0 -0
- {pico_fastapi-0.2.3.dev0 → pico_fastapi-0.3.1}/src/pico_fastapi.egg-info/dependency_links.txt +0 -0
- {pico_fastapi-0.2.3.dev0 → pico_fastapi-0.3.1}/src/pico_fastapi.egg-info/entry_points.txt +0 -0
- {pico_fastapi-0.2.3.dev0 → pico_fastapi-0.3.1}/src/pico_fastapi.egg-info/requires.txt +0 -0
- {pico_fastapi-0.2.3.dev0 → pico_fastapi-0.3.1}/src/pico_fastapi.egg-info/top_level.txt +0 -0
- {pico_fastapi-0.2.3.dev0 → pico_fastapi-0.3.1}/tests/test_session_cart.py +0 -0
- {pico_fastapi-0.2.3.dev0 → pico_fastapi-0.3.1}/tox.ini +0 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
name: Bug Report
|
|
2
|
+
description: Report a bug in pico-fastapi
|
|
3
|
+
labels: ["bug"]
|
|
4
|
+
body:
|
|
5
|
+
- type: textarea
|
|
6
|
+
id: description
|
|
7
|
+
attributes:
|
|
8
|
+
label: Description
|
|
9
|
+
description: What happened?
|
|
10
|
+
validations:
|
|
11
|
+
required: true
|
|
12
|
+
- type: textarea
|
|
13
|
+
id: reproduction
|
|
14
|
+
attributes:
|
|
15
|
+
label: Steps to Reproduce
|
|
16
|
+
description: Minimal code or steps to reproduce the issue.
|
|
17
|
+
validations:
|
|
18
|
+
required: true
|
|
19
|
+
- type: input
|
|
20
|
+
id: version
|
|
21
|
+
attributes:
|
|
22
|
+
label: pico-fastapi version
|
|
23
|
+
placeholder: "0.2.2"
|
|
24
|
+
validations:
|
|
25
|
+
required: true
|
|
26
|
+
- type: input
|
|
27
|
+
id: python-version
|
|
28
|
+
attributes:
|
|
29
|
+
label: Python version
|
|
30
|
+
placeholder: "3.11"
|
|
31
|
+
validations:
|
|
32
|
+
required: true
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
name: Feature Request
|
|
2
|
+
description: Suggest an enhancement for pico-fastapi
|
|
3
|
+
labels: ["enhancement"]
|
|
4
|
+
body:
|
|
5
|
+
- type: textarea
|
|
6
|
+
id: problem
|
|
7
|
+
attributes:
|
|
8
|
+
label: Problem
|
|
9
|
+
description: What problem does this solve?
|
|
10
|
+
validations:
|
|
11
|
+
required: true
|
|
12
|
+
- type: textarea
|
|
13
|
+
id: solution
|
|
14
|
+
attributes:
|
|
15
|
+
label: Proposed Solution
|
|
16
|
+
description: How should it work?
|
|
17
|
+
validations:
|
|
18
|
+
required: true
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
## Summary
|
|
2
|
+
|
|
3
|
+
<!-- Brief description of the changes -->
|
|
4
|
+
|
|
5
|
+
## Checklist
|
|
6
|
+
|
|
7
|
+
- [ ] Tests pass (`pytest tests/ -v`)
|
|
8
|
+
- [ ] Code formatted (`ruff format src/ tests/`)
|
|
9
|
+
- [ ] Lint clean (`ruff check src/ tests/`)
|
|
10
|
+
- [ ] CHANGELOG.md updated (if user-facing change)
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches: [main]
|
|
5
|
+
pull_request:
|
|
6
|
+
branches: [main]
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
lint:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v7
|
|
13
|
+
- uses: actions/setup-python@v6
|
|
14
|
+
with:
|
|
15
|
+
python-version: "3.11"
|
|
16
|
+
- run: pip install ruff
|
|
17
|
+
- run: ruff check src/ tests/
|
|
18
|
+
- run: ruff format --check src/ tests/
|
|
19
|
+
|
|
20
|
+
tests:
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
strategy:
|
|
23
|
+
matrix:
|
|
24
|
+
python-version: ["3.11", "3.12", "3.13", "3.14"]
|
|
25
|
+
steps:
|
|
26
|
+
- uses: actions/checkout@v7
|
|
27
|
+
with:
|
|
28
|
+
fetch-depth: 0
|
|
29
|
+
- uses: actions/setup-python@v6
|
|
30
|
+
with:
|
|
31
|
+
python-version: ${{ matrix.python-version }}
|
|
32
|
+
- run: pip install tox
|
|
33
|
+
- name: Run tests with coverage
|
|
34
|
+
env:
|
|
35
|
+
SETUPTOOLS_SCM_PRETEND_VERSION: "0.1.0"
|
|
36
|
+
run: |
|
|
37
|
+
tox -e cov
|
|
38
|
+
mv .coverage .coverage.${{ matrix.python-version }}
|
|
39
|
+
- uses: actions/upload-artifact@v7
|
|
40
|
+
with:
|
|
41
|
+
name: coverage-${{ matrix.python-version }}
|
|
42
|
+
path: .coverage.${{ matrix.python-version }}
|
|
43
|
+
include-hidden-files: true
|
|
44
|
+
if-no-files-found: error
|
|
45
|
+
|
|
46
|
+
coverage:
|
|
47
|
+
needs: tests
|
|
48
|
+
runs-on: ubuntu-latest
|
|
49
|
+
steps:
|
|
50
|
+
- uses: actions/checkout@v7
|
|
51
|
+
- uses: actions/setup-python@v6
|
|
52
|
+
with:
|
|
53
|
+
python-version: "3.12"
|
|
54
|
+
- uses: actions/download-artifact@v8
|
|
55
|
+
with:
|
|
56
|
+
path: coverage-reports
|
|
57
|
+
- name: Combine and upload
|
|
58
|
+
run: |
|
|
59
|
+
pip install coverage
|
|
60
|
+
files=$(find coverage-reports -type f -name ".coverage.*")
|
|
61
|
+
if [ -z "$files" ]; then echo "No coverage files"; exit 1; fi
|
|
62
|
+
coverage combine $files
|
|
63
|
+
coverage xml
|
|
64
|
+
- uses: codecov/codecov-action@v7
|
|
65
|
+
continue-on-error: true
|
|
66
|
+
with:
|
|
67
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
68
|
+
files: coverage.xml
|
|
69
|
+
fail_ci_if_error: false
|
|
70
|
+
|
|
71
|
+
sonar:
|
|
72
|
+
if: github.event_name == 'push'
|
|
73
|
+
needs: tests
|
|
74
|
+
runs-on: ubuntu-latest
|
|
75
|
+
steps:
|
|
76
|
+
- uses: actions/checkout@v7
|
|
77
|
+
with:
|
|
78
|
+
fetch-depth: 0
|
|
79
|
+
- uses: SonarSource/sonarqube-scan-action@v6
|
|
80
|
+
env:
|
|
81
|
+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
|
82
|
+
with:
|
|
83
|
+
args: >
|
|
84
|
+
-Dsonar.host.url=https://sonarcloud.io
|
|
85
|
+
-Dsonar.organization=dperezcabrera
|
|
86
|
+
-Dsonar.projectKey=dperezcabrera_${{ github.event.repository.name }}
|
|
87
|
+
-Dsonar.projectName=${{ github.event.repository.name }}
|
|
88
|
+
-Dsonar.sources=src
|
|
89
|
+
-Dsonar.tests=tests
|
|
90
|
+
-Dsonar.python.version=3.11,3.12,3.13,3.14
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
name: CodeQL
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches: [main]
|
|
5
|
+
pull_request:
|
|
6
|
+
branches: [main]
|
|
7
|
+
schedule:
|
|
8
|
+
- cron: "0 6 * * 1"
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
security-events: write
|
|
12
|
+
contents: read
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
analyze:
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v7
|
|
19
|
+
- uses: github/codeql-action/init@v4
|
|
20
|
+
with: { languages: python }
|
|
21
|
+
- uses: github/codeql-action/analyze@v4
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
name: Docs
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches: [main]
|
|
5
|
+
paths: [docs/**, mkdocs.yml]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
paths: [docs/**, mkdocs.yml]
|
|
9
|
+
workflow_dispatch:
|
|
10
|
+
|
|
11
|
+
permissions:
|
|
12
|
+
contents: write
|
|
13
|
+
pages: write
|
|
14
|
+
id-token: write
|
|
15
|
+
|
|
16
|
+
concurrency:
|
|
17
|
+
group: pages
|
|
18
|
+
cancel-in-progress: false
|
|
19
|
+
|
|
20
|
+
jobs:
|
|
21
|
+
validate:
|
|
22
|
+
if: github.event_name == 'pull_request'
|
|
23
|
+
runs-on: ubuntu-latest
|
|
24
|
+
steps:
|
|
25
|
+
- uses: actions/checkout@v7
|
|
26
|
+
with: { fetch-depth: 0 }
|
|
27
|
+
- uses: actions/setup-python@v6
|
|
28
|
+
with: { python-version: "3.12" }
|
|
29
|
+
- run: pip install -r docs/requirements.txt
|
|
30
|
+
- run: mkdocs build --strict
|
|
31
|
+
|
|
32
|
+
deploy:
|
|
33
|
+
if: github.event_name != 'pull_request'
|
|
34
|
+
runs-on: ubuntu-latest
|
|
35
|
+
environment:
|
|
36
|
+
name: github-pages
|
|
37
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
38
|
+
steps:
|
|
39
|
+
- uses: actions/checkout@v7
|
|
40
|
+
with: { fetch-depth: 0 }
|
|
41
|
+
- uses: actions/setup-python@v6
|
|
42
|
+
with: { python-version: "3.12" }
|
|
43
|
+
- run: pip install -r docs/requirements.txt
|
|
44
|
+
- run: mkdocs build --strict --verbose
|
|
45
|
+
- uses: actions/upload-pages-artifact@v5
|
|
46
|
+
with: { path: site }
|
|
47
|
+
- id: deployment
|
|
48
|
+
uses: actions/deploy-pages@v5
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
on:
|
|
3
|
+
release:
|
|
4
|
+
types: [published]
|
|
5
|
+
|
|
6
|
+
permissions:
|
|
7
|
+
id-token: write
|
|
8
|
+
contents: read
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
deploy:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v7
|
|
15
|
+
with: { fetch-depth: 0 }
|
|
16
|
+
- uses: actions/setup-python@v6
|
|
17
|
+
with: { python-version: "3.x" }
|
|
18
|
+
- run: pip install build
|
|
19
|
+
- run: python -m build
|
|
20
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
21
|
+
with:
|
|
22
|
+
skip-existing: true
|
|
23
|
+
verify-metadata: true
|
|
24
|
+
attestations: true
|
|
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.h
|
|
|
7
7
|
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
+
## v0.3.0 — Breaking: Configurer Rename (2026-02-20)
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
- **Breaking:** Renamed `FastApiConfigurer.configure(app)` to `configure_app(app)` to avoid protocol collision with `DatabaseConfigurer.configure(engine)` in structural typing.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
10
17
|
## v0.2.2 — Internal Quality (2026-02-06)
|
|
11
18
|
|
|
12
19
|
### Changed
|
|
@@ -34,17 +41,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.h
|
|
|
34
41
|
### Changed
|
|
35
42
|
- Bumped `pico-ioc` dependency from `>= 2.1.3` to `>= 2.2.0`.
|
|
36
43
|
- Dropped Python 3.10 from CI matrix, tox and Makefile (requires-python is `>=3.11`).
|
|
37
|
-
-
|
|
44
|
+
- Reverted `version_scheme` to `post-release` (`guess-next-dev` caused `.dev0` versions to leak to PyPI).
|
|
38
45
|
|
|
39
46
|
---
|
|
40
47
|
|
|
41
48
|
## v0.2.0 — Ecosystem Integration (2025-11-25)
|
|
42
49
|
|
|
43
|
-
###
|
|
50
|
+
### New
|
|
44
51
|
- Added native `pico-boot` auto-discovery using the `pico_boot.modules` entry point.
|
|
45
52
|
- `pico-fastapi` is now automatically detected and loaded when initializing applications with `pico-boot`.
|
|
46
53
|
|
|
47
|
-
###
|
|
54
|
+
### No Behavioral Changes
|
|
48
55
|
- No updates to middleware behavior.
|
|
49
56
|
- No DI or request lifecycle changes.
|
|
50
57
|
- No breaking changes.
|
|
@@ -11,7 +11,7 @@ pico-fastapi provides FastAPI integration for pico-ioc. It uses:
|
|
|
11
11
|
## Key Reminders
|
|
12
12
|
|
|
13
13
|
- pico-ioc dependency: `>= 2.2.0`
|
|
14
|
-
- `version_scheme
|
|
14
|
+
- **NEVER change `version_scheme`** in pyproject.toml. It MUST remain `"post-release"`. Changing it to `"guess-next-dev"` causes `.dev0` versions to leak to PyPI. This was already fixed once — do not revert it.
|
|
15
15
|
- requires-python >= 3.11
|
|
16
16
|
- Commit messages: one line only
|
|
17
17
|
- CI badge must point to `pico-fastapi` repo (not pico-ioc)
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our
|
|
6
|
+
community a harassment-free experience for everyone.
|
|
7
|
+
|
|
8
|
+
## Our Standards
|
|
9
|
+
|
|
10
|
+
Examples of behavior that contributes to a positive environment:
|
|
11
|
+
|
|
12
|
+
* Using welcoming and inclusive language
|
|
13
|
+
* Being respectful of differing viewpoints and experiences
|
|
14
|
+
* Gracefully accepting constructive criticism
|
|
15
|
+
* Focusing on what is best for the community
|
|
16
|
+
|
|
17
|
+
Examples of unacceptable behavior:
|
|
18
|
+
|
|
19
|
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
|
20
|
+
* Public or private harassment
|
|
21
|
+
* Publishing others' private information without explicit permission
|
|
22
|
+
|
|
23
|
+
## Enforcement
|
|
24
|
+
|
|
25
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
26
|
+
reported to **dperezcabrera@gmail.com**. All complaints will be reviewed
|
|
27
|
+
and investigated promptly and fairly.
|
|
28
|
+
|
|
29
|
+
## Attribution
|
|
30
|
+
|
|
31
|
+
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/), version 2.1.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Contributing to Pico-FastAPI
|
|
2
|
+
|
|
3
|
+
## Development Setup
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
python -m venv .venv
|
|
7
|
+
source .venv/bin/activate
|
|
8
|
+
pip install -e ".[test]"
|
|
9
|
+
pip install ruff
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Running Tests
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
pytest tests/ -v # Run tests
|
|
16
|
+
tox # Full matrix (3.11-3.14)
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Code Style
|
|
20
|
+
|
|
21
|
+
- Python 3.11+
|
|
22
|
+
- Format with `ruff format src/ tests/`
|
|
23
|
+
- Lint with `ruff check src/ tests/`
|
|
24
|
+
|
|
25
|
+
## Pull Requests
|
|
26
|
+
|
|
27
|
+
1. Fork the repository
|
|
28
|
+
2. Create a feature branch
|
|
29
|
+
3. Ensure tests pass and code is formatted
|
|
30
|
+
4. Submit a PR with a clear description
|
|
31
|
+
|
|
32
|
+
## Reporting Issues
|
|
33
|
+
|
|
34
|
+
Use [GitHub Issues](https://github.com/dperezcabrera/pico-fastapi/issues) for bugs and feature requests.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pico-fastapi
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.1
|
|
4
4
|
Summary: Pico-ioc integration for FastAPI. Adds Spring Boot-style controllers, autoconfiguration, and scopes (request, websocket, session).
|
|
5
5
|
Author-email: David Perez Cabrera <dperezcabrera@gmail.com>
|
|
6
6
|
License: MIT License
|
|
@@ -28,6 +28,8 @@ License: MIT License
|
|
|
28
28
|
Project-URL: Homepage, https://github.com/dperezcabrera/pico-fastapi
|
|
29
29
|
Project-URL: Repository, https://github.com/dperezcabrera/pico-fastapi
|
|
30
30
|
Project-URL: Issue Tracker, https://github.com/dperezcabrera/pico-fastapi/issues
|
|
31
|
+
Project-URL: Documentation, https://dperezcabrera.github.io/pico-fastapi/
|
|
32
|
+
Project-URL: Changelog, https://github.com/dperezcabrera/pico-fastapi/blob/main/CHANGELOG.md
|
|
31
33
|
Keywords: ioc,di,dependency injection,fastapi,inversion of control,spring boot,controller
|
|
32
34
|
Classifier: Development Status :: 4 - Beta
|
|
33
35
|
Classifier: Framework :: FastAPI
|
|
@@ -38,8 +40,10 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
38
40
|
Classifier: Programming Language :: Python :: 3.12
|
|
39
41
|
Classifier: Programming Language :: Python :: 3.13
|
|
40
42
|
Classifier: Programming Language :: Python :: 3.14
|
|
43
|
+
Classifier: Intended Audience :: Developers
|
|
41
44
|
Classifier: License :: OSI Approved :: MIT License
|
|
42
45
|
Classifier: Operating System :: OS Independent
|
|
46
|
+
Classifier: Typing :: Typed
|
|
43
47
|
Requires-Python: >=3.11
|
|
44
48
|
Description-Content-Type: text/markdown
|
|
45
49
|
License-File: LICENSE
|
|
@@ -51,7 +55,7 @@ Provides-Extra: run
|
|
|
51
55
|
Requires-Dist: uvicorn[standard]; extra == "run"
|
|
52
56
|
Dynamic: license-file
|
|
53
57
|
|
|
54
|
-
#
|
|
58
|
+
# pico-fastapi
|
|
55
59
|
|
|
56
60
|
[](https://pypi.org/project/pico-fastapi/)
|
|
57
61
|
[](https://deepwiki.com/dperezcabrera/pico-fastapi)
|
|
@@ -62,6 +66,7 @@ Dynamic: license-file
|
|
|
62
66
|
[](https://sonarcloud.io/summary/new_code?id=dperezcabrera_pico-fastapi)
|
|
63
67
|
[](https://sonarcloud.io/summary/new_code?id=dperezcabrera_pico-fastapi)
|
|
64
68
|
[](https://dperezcabrera.github.io/pico-fastapi/)
|
|
69
|
+
[](https://dperezcabrera.github.io/pico-learn/)
|
|
65
70
|
|
|
66
71
|
# Pico-FastAPI
|
|
67
72
|
|
|
@@ -69,17 +74,17 @@ Dynamic: license-file
|
|
|
69
74
|
|
|
70
75
|
It provides scoped lifecycles, automatic controller registration, and clean architectural boundaries, without global state and without FastAPI’s function-based dependency system.
|
|
71
76
|
|
|
72
|
-
>
|
|
73
|
-
>
|
|
74
|
-
>
|
|
75
|
-
>
|
|
76
|
-
>
|
|
77
|
+
> Requires Python 3.11+
|
|
78
|
+
> Built on FastAPI
|
|
79
|
+
> Fully async-compatible
|
|
80
|
+
> Real IoC with constructor injection
|
|
81
|
+
> Supports singleton, request, session, and websocket scopes
|
|
77
82
|
|
|
78
83
|
With Pico-FastAPI you get the speed, clarity, and async performance of FastAPI, enhanced by a real IoC container for clean, testable, and maintainable applications.
|
|
79
84
|
|
|
80
85
|
---
|
|
81
86
|
|
|
82
|
-
##
|
|
87
|
+
## Why pico-fastapi
|
|
83
88
|
|
|
84
89
|
FastAPI’s built-in dependency system is function-based, which often ties business logic to the framework. Pico-FastAPI moves dependency resolution into the IoC container, promoting separation of concerns and testability.
|
|
85
90
|
|
|
@@ -92,7 +97,7 @@ FastAPI’s built-in dependency system is function-based, which often ties busin
|
|
|
92
97
|
|
|
93
98
|
---
|
|
94
99
|
|
|
95
|
-
##
|
|
100
|
+
## Core Features
|
|
96
101
|
|
|
97
102
|
- Controller classes with `@controller`
|
|
98
103
|
- Route decorators: `@get`, `@post`, `@put`, `@delete`, `@patch`, `@websocket`
|
|
@@ -103,15 +108,15 @@ FastAPI’s built-in dependency system is function-based, which often ties busin
|
|
|
103
108
|
|
|
104
109
|
---
|
|
105
110
|
|
|
106
|
-
##
|
|
111
|
+
## Installation
|
|
107
112
|
|
|
108
113
|
```bash
|
|
109
114
|
pip install pico-fastapi
|
|
110
|
-
|
|
115
|
+
```
|
|
111
116
|
|
|
112
117
|
---
|
|
113
118
|
|
|
114
|
-
##
|
|
119
|
+
## Quick Example
|
|
115
120
|
|
|
116
121
|
```python
|
|
117
122
|
from pico_fastapi import controller, get
|
|
@@ -151,7 +156,7 @@ app = container.get(FastAPI)
|
|
|
151
156
|
```
|
|
152
157
|
---
|
|
153
158
|
|
|
154
|
-
#
|
|
159
|
+
# Quick Example (with pico-boot auto-discovery)
|
|
155
160
|
|
|
156
161
|
### 1. Controller
|
|
157
162
|
|
|
@@ -200,7 +205,7 @@ app = container.get(FastAPI)
|
|
|
200
205
|
|
|
201
206
|
---
|
|
202
207
|
|
|
203
|
-
##
|
|
208
|
+
## WebSocket Example
|
|
204
209
|
|
|
205
210
|
```python
|
|
206
211
|
from pico_fastapi import controller, websocket
|
|
@@ -218,7 +223,7 @@ class ChatController:
|
|
|
218
223
|
|
|
219
224
|
---
|
|
220
225
|
|
|
221
|
-
##
|
|
226
|
+
## Testing with Overrides
|
|
222
227
|
|
|
223
228
|
```python
|
|
224
229
|
from pico_ioc import init
|
|
@@ -242,7 +247,7 @@ assert client.get("/api/hello").json() == {"msg": "test"}
|
|
|
242
247
|
|
|
243
248
|
---
|
|
244
249
|
|
|
245
|
-
##
|
|
250
|
+
## Static Files Configuration Example
|
|
246
251
|
|
|
247
252
|
```python
|
|
248
253
|
from dataclasses import dataclass
|
|
@@ -263,7 +268,7 @@ class StaticFilesConfigurer(FastApiConfigurer):
|
|
|
263
268
|
priority = -100
|
|
264
269
|
def __init__(self, settings: StaticSettings):
|
|
265
270
|
self.settings = settings
|
|
266
|
-
def
|
|
271
|
+
def configure_app(self, app: FastAPI) -> None:
|
|
267
272
|
app.mount(self.settings.static_url, StaticFiles(directory=self.settings.static_dir), name="static")
|
|
268
273
|
```
|
|
269
274
|
|
|
@@ -295,7 +300,7 @@ fastapi:
|
|
|
295
300
|
|
|
296
301
|
---
|
|
297
302
|
|
|
298
|
-
##
|
|
303
|
+
## JWT Authentication Configuration Example
|
|
299
304
|
|
|
300
305
|
```python
|
|
301
306
|
import base64
|
|
@@ -358,7 +363,7 @@ class JwtConfigurer(FastApiConfigurer):
|
|
|
358
363
|
def __init__(self, container: PicoContainer, settings: JwtSettings):
|
|
359
364
|
self.container = container
|
|
360
365
|
self.settings = settings
|
|
361
|
-
def
|
|
366
|
+
def configure_app(self, app: FastAPI) -> None:
|
|
362
367
|
app.add_middleware(JwtMiddleware, container=self.container, secret=self.settings.secret)
|
|
363
368
|
```
|
|
364
369
|
|
|
@@ -391,7 +396,7 @@ app = container.get(FastAPI)
|
|
|
391
396
|
|
|
392
397
|
---
|
|
393
398
|
|
|
394
|
-
##
|
|
399
|
+
## How It Works
|
|
395
400
|
|
|
396
401
|
* Controller classes are discovered and registered automatically
|
|
397
402
|
* Each route executes within its own request or websocket scope
|
|
@@ -402,20 +407,27 @@ No global state and no implicit singletons.
|
|
|
402
407
|
|
|
403
408
|
---
|
|
404
409
|
|
|
405
|
-
##
|
|
410
|
+
## AI Coding Skills
|
|
411
|
+
|
|
412
|
+
Install [Claude Code](https://code.claude.com) or [OpenAI Codex](https://openai.com/index/introducing-codex/) skills for AI-assisted development with pico-fastapi:
|
|
413
|
+
|
|
414
|
+
```bash
|
|
415
|
+
curl -sL https://raw.githubusercontent.com/dperezcabrera/pico-skills/main/install.sh | bash -s -- fastapi
|
|
416
|
+
```
|
|
406
417
|
|
|
407
|
-
|
|
418
|
+
| Command | Description |
|
|
419
|
+
|---------|-------------|
|
|
420
|
+
| `/add-controller` | Add FastAPI controllers with route decorators |
|
|
421
|
+
| `/add-component` | Add components, factories, interceptors, settings |
|
|
422
|
+
| `/add-tests` | Generate tests for pico components |
|
|
408
423
|
|
|
409
|
-
|
|
410
|
-
|-------|---------|-------------|
|
|
411
|
-
| **Pico FastAPI Endpoint** | `/pico-fastapi` | Creates endpoints with controller-based routing and DI |
|
|
412
|
-
| **Pico Test Generator** | `/pico-tests` | Generates tests for pico-framework components |
|
|
424
|
+
All skills: `curl -sL https://raw.githubusercontent.com/dperezcabrera/pico-skills/main/install.sh | bash`
|
|
413
425
|
|
|
414
|
-
See [
|
|
426
|
+
See [pico-skills](https://github.com/dperezcabrera/pico-skills) for details.
|
|
415
427
|
|
|
416
428
|
---
|
|
417
429
|
|
|
418
|
-
##
|
|
430
|
+
## License
|
|
419
431
|
|
|
420
432
|
MIT
|
|
421
433
|
|