fastapi-voyager 0.16.0a1__tar.gz → 0.16.0a3__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.
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/PKG-INFO +31 -7
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/README.md +8 -2
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/docs/changelog.md +4 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/pyproject.toml +28 -3
- fastapi_voyager-0.16.0a3/setup-django-ninja.sh +48 -0
- fastapi_voyager-0.16.0a3/setup-fastapi.sh +48 -0
- fastapi_voyager-0.16.0a3/setup-litestar.sh +48 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/adapters/base.py +0 -10
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/adapters/django_ninja_adapter.py +12 -11
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/adapters/fastapi_adapter.py +10 -9
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/adapters/litestar_adapter.py +7 -8
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/cli.py +108 -56
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/introspectors/fastapi.py +15 -4
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/server.py +7 -0
- fastapi_voyager-0.16.0a3/src/fastapi_voyager/version.py +2 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/tests/litestar/demo.py +7 -1
- fastapi_voyager-0.16.0a3/tests/litestar/embedding.py +53 -0
- fastapi_voyager-0.16.0a3/tests/test_adapter_interface.py +166 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/uv.lock +92 -10
- fastapi_voyager-0.16.0a1/src/fastapi_voyager/version.py +0 -2
- fastapi_voyager-0.16.0a1/tests/litestar/embedding.py +0 -89
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/.githooks/README.md +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/.githooks/pre-commit +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/.github/workflows/publish.yml +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/.gitignore +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/.prettierignore +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/.prettierrc +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/.python-version +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/CONTRIBUTING.md +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/LICENSE +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/docs/claude/0_REFACTORING_RENDER_NOTES.md +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/docs/idea.md +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/package-lock.json +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/release.md +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/setup-hooks.sh +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/__init__.py +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/adapters/__init__.py +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/adapters/common.py +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/er_diagram.py +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/filter.py +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/introspectors/__init__.py +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/introspectors/base.py +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/introspectors/detector.py +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/introspectors/django_ninja.py +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/introspectors/litestar.py +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/module.py +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/pydantic_resolve_util.py +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/render.py +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/render_style.py +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/templates/dot/cluster.j2 +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/templates/dot/cluster_container.j2 +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/templates/dot/digraph.j2 +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/templates/dot/er_diagram.j2 +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/templates/dot/link.j2 +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/templates/dot/route_node.j2 +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/templates/dot/schema_node.j2 +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/templates/dot/tag_node.j2 +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/templates/html/colored_text.j2 +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/templates/html/pydantic_meta.j2 +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/templates/html/schema_field_row.j2 +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/templates/html/schema_header.j2 +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/templates/html/schema_table.j2 +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/type.py +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/type_helper.py +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/voyager.py +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/web/component/demo.js +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/web/component/render-graph.js +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/web/component/route-code-display.js +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/web/component/schema-code-display.js +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/web/graph-ui.js +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/web/graphviz.svg.css +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/web/graphviz.svg.js +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/web/icon/android-chrome-192x192.png +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/web/icon/android-chrome-512x512.png +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/web/icon/apple-touch-icon.png +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/web/icon/favicon-16x16.png +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/web/icon/favicon-32x32.png +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/web/icon/favicon.ico +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/web/icon/site.webmanifest +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/web/index.html +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/web/quasar.min.css +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/web/quasar.min.js +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/web/store.js +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/src/fastapi_voyager/web/vue-main.js +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/tests/README.md +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/tests/__init__.py +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/tests/django_ninja/__init__.py +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/tests/django_ninja/demo.py +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/tests/django_ninja/embedding.py +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/tests/django_ninja/settings.py +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/tests/django_ninja/urls.py +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/tests/embedding_test_utils.py +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/tests/fastapi/__init__.py +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/tests/fastapi/demo.py +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/tests/fastapi/demo_anno.py +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/tests/fastapi/embedding.py +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/tests/litestar/__init__.py +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/tests/service/__init__.py +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/tests/service/schema/__init__.py +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/tests/service/schema/base_entity.py +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/tests/service/schema/extra.py +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/tests/service/schema/schema.py +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/tests/test_analysis.py +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/tests/test_embedding_django_ninja.py +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/tests/test_embedding_fastapi.py +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/tests/test_embedding_litestar.py +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/tests/test_filter.py +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/tests/test_generic.py +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/tests/test_import.py +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/tests/test_module.py +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/tests/test_resolve_util_impl.py +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/tests/test_type_helper.py +0 -0
- {fastapi_voyager-0.16.0a1 → fastapi_voyager-0.16.0a3}/voyager.jpg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fastapi-voyager
|
|
3
|
-
Version: 0.16.
|
|
3
|
+
Version: 0.16.0a3
|
|
4
4
|
Summary: Visualize FastAPI application's routing tree and dependencies
|
|
5
5
|
Project-URL: Homepage, https://github.com/allmonday/fastapi-voyager
|
|
6
6
|
Project-URL: Source, https://github.com/allmonday/fastapi-voyager
|
|
@@ -20,15 +20,33 @@ Classifier: Programming Language :: Python :: 3.14
|
|
|
20
20
|
Requires-Python: >=3.10
|
|
21
21
|
Requires-Dist: jinja2>=3.0.0
|
|
22
22
|
Requires-Dist: pydantic-resolve>=2.4.3
|
|
23
|
+
Provides-Extra: all
|
|
24
|
+
Requires-Dist: django-ninja>=1.5.3; extra == 'all'
|
|
25
|
+
Requires-Dist: django>=4.2; extra == 'all'
|
|
26
|
+
Requires-Dist: fastapi>=0.110; extra == 'all'
|
|
27
|
+
Requires-Dist: httpx; extra == 'all'
|
|
28
|
+
Requires-Dist: litestar>=2.19.0; extra == 'all'
|
|
29
|
+
Requires-Dist: pydantic>=2.0; extra == 'all'
|
|
30
|
+
Requires-Dist: pytest; extra == 'all'
|
|
31
|
+
Requires-Dist: pytest-asyncio; extra == 'all'
|
|
32
|
+
Requires-Dist: ruff; extra == 'all'
|
|
33
|
+
Requires-Dist: uvicorn; extra == 'all'
|
|
23
34
|
Provides-Extra: dev
|
|
24
|
-
Requires-Dist: django-ninja; extra == 'dev'
|
|
25
|
-
Requires-Dist: fastapi>=0.110; extra == 'dev'
|
|
26
35
|
Requires-Dist: httpx; extra == 'dev'
|
|
27
|
-
Requires-Dist: litestar; extra == 'dev'
|
|
28
36
|
Requires-Dist: pytest; extra == 'dev'
|
|
29
37
|
Requires-Dist: pytest-asyncio; extra == 'dev'
|
|
30
38
|
Requires-Dist: ruff; extra == 'dev'
|
|
31
|
-
|
|
39
|
+
Provides-Extra: django-ninja
|
|
40
|
+
Requires-Dist: django-ninja>=1.5.3; extra == 'django-ninja'
|
|
41
|
+
Requires-Dist: django>=4.2; extra == 'django-ninja'
|
|
42
|
+
Requires-Dist: uvicorn; extra == 'django-ninja'
|
|
43
|
+
Provides-Extra: fastapi
|
|
44
|
+
Requires-Dist: fastapi>=0.110; extra == 'fastapi'
|
|
45
|
+
Requires-Dist: uvicorn; extra == 'fastapi'
|
|
46
|
+
Provides-Extra: litestar
|
|
47
|
+
Requires-Dist: litestar>=2.19.0; extra == 'litestar'
|
|
48
|
+
Requires-Dist: pydantic>=2.0; extra == 'litestar'
|
|
49
|
+
Requires-Dist: uvicorn; extra == 'litestar'
|
|
32
50
|
Description-Content-Type: text/markdown
|
|
33
51
|
|
|
34
52
|
[](https://pypi.python.org/pypi/fastapi-voyager)
|
|
@@ -301,8 +319,14 @@ Set `enable_pydantic_resolve_meta=True` in `create_voyager`, then toggle the "py
|
|
|
301
319
|
### Start Server
|
|
302
320
|
|
|
303
321
|
```bash
|
|
304
|
-
#
|
|
305
|
-
voyager -m tests.demo --server
|
|
322
|
+
# FastAPI
|
|
323
|
+
voyager -m tests.demo --server --web fastapi
|
|
324
|
+
|
|
325
|
+
# Django Ninja
|
|
326
|
+
voyager -m tests.demo --server --web django-ninja
|
|
327
|
+
|
|
328
|
+
# Litestar
|
|
329
|
+
voyager -m tests.demo --server --web litestar
|
|
306
330
|
|
|
307
331
|
# Custom port
|
|
308
332
|
voyager -m tests.demo --server --port=8002
|
|
@@ -268,8 +268,14 @@ Set `enable_pydantic_resolve_meta=True` in `create_voyager`, then toggle the "py
|
|
|
268
268
|
### Start Server
|
|
269
269
|
|
|
270
270
|
```bash
|
|
271
|
-
#
|
|
272
|
-
voyager -m tests.demo --server
|
|
271
|
+
# FastAPI
|
|
272
|
+
voyager -m tests.demo --server --web fastapi
|
|
273
|
+
|
|
274
|
+
# Django Ninja
|
|
275
|
+
voyager -m tests.demo --server --web django-ninja
|
|
276
|
+
|
|
277
|
+
# Litestar
|
|
278
|
+
voyager -m tests.demo --server --web litestar
|
|
273
279
|
|
|
274
280
|
# Custom port
|
|
275
281
|
voyager -m tests.demo --server --port=8002
|
|
@@ -31,7 +31,11 @@ Homepage = "https://github.com/allmonday/fastapi-voyager"
|
|
|
31
31
|
Source = "https://github.com/allmonday/fastapi-voyager"
|
|
32
32
|
|
|
33
33
|
[project.optional-dependencies]
|
|
34
|
-
dev = ["
|
|
34
|
+
dev = ["ruff", "pytest", "pytest-asyncio", "httpx"]
|
|
35
|
+
fastapi = ["fastapi>=0.110", "uvicorn"]
|
|
36
|
+
django-ninja = ["django>=4.2", "django-ninja>=1.5.3", "uvicorn"]
|
|
37
|
+
litestar = ["litestar>=2.19.0", "pydantic>=2.0", "uvicorn"]
|
|
38
|
+
all = ["fastapi-voyager[dev,fastapi,django-ninja,litestar]"]
|
|
35
39
|
|
|
36
40
|
[build-system]
|
|
37
41
|
requires = ["hatchling"]
|
|
@@ -54,9 +58,30 @@ select = ["E", "F", "I", "UP", "B"]
|
|
|
54
58
|
|
|
55
59
|
[dependency-groups]
|
|
56
60
|
dev = [
|
|
61
|
+
"httpx>=0.28.1",
|
|
62
|
+
"pytest-asyncio>=1.3.0",
|
|
63
|
+
"pytest>=8.0.0",
|
|
64
|
+
"ruff>=0.9.0",
|
|
65
|
+
]
|
|
66
|
+
fastapi = [
|
|
67
|
+
"fastapi>=0.116.1",
|
|
68
|
+
"uvicorn>=0.34.0",
|
|
69
|
+
]
|
|
70
|
+
django-ninja = [
|
|
71
|
+
"django>=4.2",
|
|
72
|
+
"django-ninja>=1.5.3",
|
|
73
|
+
"uvicorn>=0.34.0",
|
|
74
|
+
]
|
|
75
|
+
litestar = [
|
|
76
|
+
"litestar>=2.19.0",
|
|
77
|
+
"pydantic>=2.0",
|
|
78
|
+
"uvicorn>=0.34.0",
|
|
79
|
+
]
|
|
80
|
+
all = [
|
|
81
|
+
"django>=4.2",
|
|
57
82
|
"django-ninja>=1.5.3",
|
|
58
83
|
"fastapi>=0.116.1",
|
|
59
|
-
"httpx>=0.28.1",
|
|
60
84
|
"litestar>=2.19.0",
|
|
61
|
-
"
|
|
85
|
+
"pydantic>=2.0",
|
|
86
|
+
"uvicorn>=0.34.0",
|
|
62
87
|
]
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Django Ninja Development Setup Script
|
|
3
|
+
# Usage: ./setup-django-ninja.sh [--no-sync]
|
|
4
|
+
|
|
5
|
+
set -e
|
|
6
|
+
|
|
7
|
+
echo "🚀 Setting up Django Ninja development environment..."
|
|
8
|
+
echo ""
|
|
9
|
+
|
|
10
|
+
# Parse arguments
|
|
11
|
+
SYNC=true
|
|
12
|
+
for arg in "$@"; do
|
|
13
|
+
case $arg in
|
|
14
|
+
--no-sync)
|
|
15
|
+
SYNC=false
|
|
16
|
+
shift
|
|
17
|
+
;;
|
|
18
|
+
esac
|
|
19
|
+
done
|
|
20
|
+
|
|
21
|
+
# Sync dependencies
|
|
22
|
+
if [ "$SYNC" = true ]; then
|
|
23
|
+
echo "📦 Syncing dependencies..."
|
|
24
|
+
uv sync --group dev --group django-ninja
|
|
25
|
+
echo "✅ Dependencies synced"
|
|
26
|
+
echo ""
|
|
27
|
+
fi
|
|
28
|
+
|
|
29
|
+
# Check if uvicorn is installed
|
|
30
|
+
echo "🔍 Checking uvicorn installation..."
|
|
31
|
+
if uv run which uvicorn > /dev/null 2>&1; then
|
|
32
|
+
UVICORN_PATH=$(uv run which uvicorn)
|
|
33
|
+
echo "✅ Uvicorn found at: $UVICORN_PATH"
|
|
34
|
+
else
|
|
35
|
+
echo "❌ Uvicorn not found in project environment"
|
|
36
|
+
exit 1
|
|
37
|
+
fi
|
|
38
|
+
echo ""
|
|
39
|
+
|
|
40
|
+
# Start Django Ninja server
|
|
41
|
+
echo "🌟 Starting Django Ninja Voyager server..."
|
|
42
|
+
echo " App: tests.django_ninja.embedding:application"
|
|
43
|
+
echo " URL: http://127.0.0.1:8000"
|
|
44
|
+
echo ""
|
|
45
|
+
echo "Press Ctrl+C to stop the server"
|
|
46
|
+
echo ""
|
|
47
|
+
|
|
48
|
+
uv run uvicorn tests.django_ninja.embedding:application --reload --host 127.0.0.1 --port 8000
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# FastAPI Development Setup Script
|
|
3
|
+
# Usage: ./setup-fastapi.sh [--no-sync]
|
|
4
|
+
|
|
5
|
+
set -e
|
|
6
|
+
|
|
7
|
+
echo "🚀 Setting up FastAPI development environment..."
|
|
8
|
+
echo ""
|
|
9
|
+
|
|
10
|
+
# Parse arguments
|
|
11
|
+
SYNC=true
|
|
12
|
+
for arg in "$@"; do
|
|
13
|
+
case $arg in
|
|
14
|
+
--no-sync)
|
|
15
|
+
SYNC=false
|
|
16
|
+
shift
|
|
17
|
+
;;
|
|
18
|
+
esac
|
|
19
|
+
done
|
|
20
|
+
|
|
21
|
+
# Sync dependencies
|
|
22
|
+
if [ "$SYNC" = true ]; then
|
|
23
|
+
echo "📦 Syncing dependencies..."
|
|
24
|
+
uv sync --group dev --group fastapi
|
|
25
|
+
echo "✅ Dependencies synced"
|
|
26
|
+
echo ""
|
|
27
|
+
fi
|
|
28
|
+
|
|
29
|
+
# Check if uvicorn is installed
|
|
30
|
+
echo "🔍 Checking uvicorn installation..."
|
|
31
|
+
if uv run which uvicorn > /dev/null 2>&1; then
|
|
32
|
+
UVICORN_PATH=$(uv run which uvicorn)
|
|
33
|
+
echo "✅ Uvicorn found at: $UVICORN_PATH"
|
|
34
|
+
else
|
|
35
|
+
echo "❌ Uvicorn not found in project environment"
|
|
36
|
+
exit 1
|
|
37
|
+
fi
|
|
38
|
+
echo ""
|
|
39
|
+
|
|
40
|
+
# Start FastAPI server
|
|
41
|
+
echo "🌟 Starting FastAPI Voyager server..."
|
|
42
|
+
echo " App: tests.fastapi.embedding:app"
|
|
43
|
+
echo " URL: http://127.0.0.1:8000"
|
|
44
|
+
echo ""
|
|
45
|
+
echo "Press Ctrl+C to stop the server"
|
|
46
|
+
echo ""
|
|
47
|
+
|
|
48
|
+
uv run uvicorn tests.fastapi.embedding:app --reload --host 127.0.0.1 --port 8000
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Litestar Development Setup Script
|
|
3
|
+
# Usage: ./setup-litestar.sh [--no-sync]
|
|
4
|
+
|
|
5
|
+
set -e
|
|
6
|
+
|
|
7
|
+
echo "🚀 Setting up Litestar development environment..."
|
|
8
|
+
echo ""
|
|
9
|
+
|
|
10
|
+
# Parse arguments
|
|
11
|
+
SYNC=true
|
|
12
|
+
for arg in "$@"; do
|
|
13
|
+
case $arg in
|
|
14
|
+
--no-sync)
|
|
15
|
+
SYNC=false
|
|
16
|
+
shift
|
|
17
|
+
;;
|
|
18
|
+
esac
|
|
19
|
+
done
|
|
20
|
+
|
|
21
|
+
# Sync dependencies
|
|
22
|
+
if [ "$SYNC" = true ]; then
|
|
23
|
+
echo "📦 Syncing dependencies..."
|
|
24
|
+
uv sync --group dev --group litestar
|
|
25
|
+
echo "✅ Dependencies synced"
|
|
26
|
+
echo ""
|
|
27
|
+
fi
|
|
28
|
+
|
|
29
|
+
# Check if uvicorn is installed
|
|
30
|
+
echo "🔍 Checking uvicorn installation..."
|
|
31
|
+
if uv run which uvicorn > /dev/null 2>&1; then
|
|
32
|
+
UVICORN_PATH=$(uv run which uvicorn)
|
|
33
|
+
echo "✅ Uvicorn found at: $UVICORN_PATH"
|
|
34
|
+
else
|
|
35
|
+
echo "❌ Uvicorn not found in project environment"
|
|
36
|
+
exit 1
|
|
37
|
+
fi
|
|
38
|
+
echo ""
|
|
39
|
+
|
|
40
|
+
# Start Litestar server
|
|
41
|
+
echo "🌟 Starting Litestar Voyager server..."
|
|
42
|
+
echo " App: tests.litestar.embedding:asgi_app"
|
|
43
|
+
echo " URL: http://127.0.0.1:8000"
|
|
44
|
+
echo ""
|
|
45
|
+
echo "Press Ctrl+C to stop the server"
|
|
46
|
+
echo ""
|
|
47
|
+
|
|
48
|
+
uv run uvicorn tests.litestar.embedding:asgi_app --reload --host 127.0.0.1 --port 8000
|
|
@@ -32,13 +32,3 @@ class VoyagerAdapter(ABC):
|
|
|
32
32
|
A framework-specific application object
|
|
33
33
|
"""
|
|
34
34
|
pass
|
|
35
|
-
|
|
36
|
-
@abstractmethod
|
|
37
|
-
def get_mount_path(self) -> str:
|
|
38
|
-
"""
|
|
39
|
-
Get the recommended mount path for the voyager UI.
|
|
40
|
-
|
|
41
|
-
Returns:
|
|
42
|
-
The path where voyager should be mounted (e.g., "/voyager")
|
|
43
|
-
"""
|
|
44
|
-
pass
|
|
@@ -32,6 +32,7 @@ class DjangoNinjaAdapter(VoyagerAdapter):
|
|
|
32
32
|
ga_id: str | None = None,
|
|
33
33
|
er_diagram: Any = None,
|
|
34
34
|
enable_pydantic_resolve_meta: bool = False,
|
|
35
|
+
server_mode: bool = False,
|
|
35
36
|
):
|
|
36
37
|
self.ctx = VoyagerContext(
|
|
37
38
|
target_app=target_app,
|
|
@@ -45,6 +46,7 @@ class DjangoNinjaAdapter(VoyagerAdapter):
|
|
|
45
46
|
enable_pydantic_resolve_meta=enable_pydantic_resolve_meta,
|
|
46
47
|
framework_name="Django Ninja",
|
|
47
48
|
)
|
|
49
|
+
self.server_mode = server_mode
|
|
48
50
|
# Note: gzip should be handled by Django's middleware, not here
|
|
49
51
|
|
|
50
52
|
async def _handle_request(self, scope, receive, send):
|
|
@@ -55,8 +57,8 @@ class DjangoNinjaAdapter(VoyagerAdapter):
|
|
|
55
57
|
# Parse the request
|
|
56
58
|
method = scope["method"]
|
|
57
59
|
path = scope["path"]
|
|
58
|
-
# Remove /voyager prefix for internal routing
|
|
59
|
-
if path.startswith("/voyager"):
|
|
60
|
+
# Remove /voyager prefix for internal routing (unless in server_mode)
|
|
61
|
+
if not self.server_mode and path.startswith("/voyager"):
|
|
60
62
|
path = path[8:] # Remove '/voyager'
|
|
61
63
|
if path == "":
|
|
62
64
|
path = "/"
|
|
@@ -284,16 +286,15 @@ class DjangoNinjaAdapter(VoyagerAdapter):
|
|
|
284
286
|
"""Create and return an ASGI application."""
|
|
285
287
|
|
|
286
288
|
async def asgi_app(scope, receive, send):
|
|
287
|
-
#
|
|
288
|
-
if scope["type"] == "http"
|
|
289
|
-
|
|
289
|
+
# In server_mode, handle all paths; otherwise only handle /voyager/*
|
|
290
|
+
if scope["type"] == "http":
|
|
291
|
+
if self.server_mode or scope["path"].startswith("/voyager"):
|
|
292
|
+
await self._handle_request(scope, receive, send)
|
|
293
|
+
else:
|
|
294
|
+
# Return 404 for non-voyager paths
|
|
295
|
+
# (Django should handle these before they reach here)
|
|
296
|
+
await self._send_404(send)
|
|
290
297
|
else:
|
|
291
|
-
# Return 404 for non-voyager paths
|
|
292
|
-
# (Django should handle these before they reach here)
|
|
293
298
|
await self._send_404(send)
|
|
294
299
|
|
|
295
300
|
return asgi_app
|
|
296
|
-
|
|
297
|
-
def get_mount_path(self) -> str:
|
|
298
|
-
"""Get the recommended mount path for voyager."""
|
|
299
|
-
return "/voyager"
|
|
@@ -5,11 +5,7 @@ This module provides the FastAPI-specific implementation of the voyager server.
|
|
|
5
5
|
"""
|
|
6
6
|
from typing import Any, Literal
|
|
7
7
|
|
|
8
|
-
from fastapi import APIRouter, FastAPI
|
|
9
|
-
from fastapi.responses import HTMLResponse, JSONResponse, PlainTextResponse
|
|
10
|
-
from fastapi.staticfiles import StaticFiles
|
|
11
8
|
from pydantic import BaseModel
|
|
12
|
-
from starlette.middleware.gzip import GZipMiddleware
|
|
13
9
|
|
|
14
10
|
from fastapi_voyager.adapters.base import VoyagerAdapter
|
|
15
11
|
from fastapi_voyager.adapters.common import STATIC_FILES_PATH, VoyagerContext
|
|
@@ -83,6 +79,7 @@ class FastAPIAdapter(VoyagerAdapter):
|
|
|
83
79
|
ga_id: str | None = None,
|
|
84
80
|
er_diagram: Any = None,
|
|
85
81
|
enable_pydantic_resolve_meta: bool = False,
|
|
82
|
+
server_mode: bool = False,
|
|
86
83
|
):
|
|
87
84
|
self.ctx = VoyagerContext(
|
|
88
85
|
target_app=target_app,
|
|
@@ -97,9 +94,17 @@ class FastAPIAdapter(VoyagerAdapter):
|
|
|
97
94
|
framework_name="FastAPI",
|
|
98
95
|
)
|
|
99
96
|
self.gzip_minimum_size = gzip_minimum_size
|
|
97
|
+
# Note: server_mode is accepted for API consistency but not used
|
|
98
|
+
# since FastAPI apps are always standalone with routes at /
|
|
100
99
|
|
|
101
|
-
def create_app(self) ->
|
|
100
|
+
def create_app(self) -> Any:
|
|
102
101
|
"""Create and return a FastAPI application with voyager endpoints."""
|
|
102
|
+
# Lazy import FastAPI to avoid import errors when framework is not installed
|
|
103
|
+
from fastapi import APIRouter, FastAPI
|
|
104
|
+
from fastapi.responses import HTMLResponse, JSONResponse, PlainTextResponse
|
|
105
|
+
from fastapi.staticfiles import StaticFiles
|
|
106
|
+
from starlette.middleware.gzip import GZipMiddleware
|
|
107
|
+
|
|
103
108
|
router = APIRouter(tags=["fastapi-voyager"])
|
|
104
109
|
|
|
105
110
|
@router.post("/er-diagram", response_class=PlainTextResponse)
|
|
@@ -159,7 +164,3 @@ class FastAPIAdapter(VoyagerAdapter):
|
|
|
159
164
|
app.include_router(router)
|
|
160
165
|
|
|
161
166
|
return app
|
|
162
|
-
|
|
163
|
-
def get_mount_path(self) -> str:
|
|
164
|
-
"""Get the recommended mount path for voyager."""
|
|
165
|
-
return "/voyager"
|
|
@@ -5,9 +5,6 @@ This module provides the Litestar-specific implementation of the voyager server.
|
|
|
5
5
|
"""
|
|
6
6
|
from typing import Any
|
|
7
7
|
|
|
8
|
-
from litestar import Litestar, MediaType, Request, Response, get, post
|
|
9
|
-
from litestar.static_files import create_static_files_router
|
|
10
|
-
|
|
11
8
|
from fastapi_voyager.adapters.base import VoyagerAdapter
|
|
12
9
|
from fastapi_voyager.adapters.common import STATIC_FILES_PATH, WEB_DIR, VoyagerContext
|
|
13
10
|
from fastapi_voyager.type import CoreData, SchemaNode, Tag
|
|
@@ -32,6 +29,7 @@ class LitestarAdapter(VoyagerAdapter):
|
|
|
32
29
|
ga_id: str | None = None,
|
|
33
30
|
er_diagram: Any = None,
|
|
34
31
|
enable_pydantic_resolve_meta: bool = False,
|
|
32
|
+
server_mode: bool = False,
|
|
35
33
|
):
|
|
36
34
|
self.ctx = VoyagerContext(
|
|
37
35
|
target_app=target_app,
|
|
@@ -46,9 +44,14 @@ class LitestarAdapter(VoyagerAdapter):
|
|
|
46
44
|
framework_name="Litestar",
|
|
47
45
|
)
|
|
48
46
|
self.gzip_minimum_size = gzip_minimum_size
|
|
47
|
+
# Note: server_mode is accepted for API consistency but not used
|
|
48
|
+
# since Litestar apps are always standalone with routes at /
|
|
49
49
|
|
|
50
|
-
def create_app(self) ->
|
|
50
|
+
def create_app(self) -> Any:
|
|
51
51
|
"""Create and return a Litestar application with voyager endpoints."""
|
|
52
|
+
# Lazy import Litestar to avoid import errors when framework is not installed
|
|
53
|
+
from litestar import Litestar, MediaType, Request, Response, get, post
|
|
54
|
+
from litestar.static_files import create_static_files_router
|
|
52
55
|
|
|
53
56
|
@get("/er-diagram")
|
|
54
57
|
async def get_er_diagram(request: Request) -> str:
|
|
@@ -182,7 +185,3 @@ class LitestarAdapter(VoyagerAdapter):
|
|
|
182
185
|
for f in schema.fields
|
|
183
186
|
],
|
|
184
187
|
}
|
|
185
|
-
|
|
186
|
-
def get_mount_path(self) -> str:
|
|
187
|
-
"""Get the recommended mount path for voyager."""
|
|
188
|
-
return "/voyager"
|