mirror of
https://github.com/fastapi/fastapi.git
synced 2026-01-22 21:08:23 -05:00
Compare commits
1 Commits
additional
...
fix-instal
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9d2eb2b4dc |
1
.github/labeler.yml
vendored
1
.github/labeler.yml
vendored
@@ -31,7 +31,6 @@ internal:
|
||||
- .pre-commit-config.yaml
|
||||
- pdm_build.py
|
||||
- requirements*.txt
|
||||
- uv.lock
|
||||
- docs/en/data/sponsors.yml
|
||||
- docs/en/overrides/main.html
|
||||
- all-globs-to-all-files:
|
||||
|
||||
@@ -13,7 +13,7 @@ Create a virtual environment and install the required packages with <a href="htt
|
||||
<div class="termy">
|
||||
|
||||
```console
|
||||
$ uv sync
|
||||
$ uv sync --extra all
|
||||
|
||||
---> 100%
|
||||
```
|
||||
@@ -32,9 +32,9 @@ That way, you don't have to "install" your local version to be able to test ever
|
||||
|
||||
/// note | Technical Details
|
||||
|
||||
This only happens when you install using `uv sync` instead of running `pip install fastapi` directly.
|
||||
This only happens when you install using `uv sync --extra all` instead of running `pip install fastapi` directly.
|
||||
|
||||
That is because `uv sync` will install the local version of FastAPI in "editable" mode by default.
|
||||
That is because `uv sync --extra all` will install the local version of FastAPI in "editable" mode by default.
|
||||
|
||||
///
|
||||
|
||||
|
||||
@@ -60,7 +60,8 @@ FastAPI also includes these JavaScript-only `presets` settings:
|
||||
|
||||
```JavaScript
|
||||
presets: [
|
||||
SwaggerUIBundle.presets.apis
|
||||
SwaggerUIBundle.presets.apis,
|
||||
SwaggerUIBundle.SwaggerUIStandalonePreset
|
||||
]
|
||||
```
|
||||
|
||||
|
||||
@@ -36,7 +36,6 @@ hide:
|
||||
|
||||
### Internal
|
||||
|
||||
* 🔧 Ensure that an edit to `uv.lock` gets the `internal` label. PR [#14759](https://github.com/fastapi/fastapi/pull/14759) by [@svlandeg](https://github.com/svlandeg).
|
||||
* 🔧 Update sponsors: remove Requestly. PR [#14735](https://github.com/fastapi/fastapi/pull/14735) by [@tiangolo](https://github.com/tiangolo).
|
||||
* 🔧 Update sponsors, LambdaTest changes to TestMu AI. PR [#14734](https://github.com/fastapi/fastapi/pull/14734) by [@tiangolo](https://github.com/tiangolo).
|
||||
* ⬆ Bump actions/cache from 4 to 5. PR [#14511](https://github.com/fastapi/fastapi/pull/14511) by [@dependabot[bot]](https://github.com/apps/dependabot).
|
||||
|
||||
@@ -54,14 +54,6 @@ def get_swagger_ui_html(
|
||||
"""
|
||||
),
|
||||
] = "https://cdn.jsdelivr.net/npm/swagger-ui-dist@5/swagger-ui-bundle.js",
|
||||
swagger_extra_js_urls: Annotated[
|
||||
Optional[list[str]],
|
||||
Doc(
|
||||
"""
|
||||
The URLs of additional JavaScript files to include.
|
||||
"""
|
||||
),
|
||||
] = None,
|
||||
swagger_css_url: Annotated[
|
||||
str,
|
||||
Doc(
|
||||
@@ -106,14 +98,6 @@ def get_swagger_ui_html(
|
||||
"""
|
||||
),
|
||||
] = None,
|
||||
swagger_extra_presets: Annotated[
|
||||
Optional[list[str]],
|
||||
Doc(
|
||||
"""
|
||||
Extra presets to add to Swagger UI.
|
||||
"""
|
||||
),
|
||||
] = None,
|
||||
) -> HTMLResponse:
|
||||
"""
|
||||
Generate and return the HTML that loads Swagger UI for the interactive
|
||||
@@ -130,13 +114,6 @@ def get_swagger_ui_html(
|
||||
if swagger_ui_parameters:
|
||||
current_swagger_ui_parameters.update(swagger_ui_parameters)
|
||||
|
||||
js_urls = [swagger_js_url]
|
||||
if swagger_extra_js_urls:
|
||||
js_urls.extend(swagger_extra_js_urls)
|
||||
scripts_str = "\n ".join(
|
||||
f'<script src="{js_url}"></script>' for js_url in js_urls
|
||||
)
|
||||
|
||||
html = f"""
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
@@ -148,7 +125,7 @@ def get_swagger_ui_html(
|
||||
<body>
|
||||
<div id="swagger-ui">
|
||||
</div>
|
||||
{scripts_str}
|
||||
<script src="{swagger_js_url}"></script>
|
||||
<!-- `SwaggerUIBundle` is now available on the page -->
|
||||
<script>
|
||||
const ui = SwaggerUIBundle({{
|
||||
@@ -161,18 +138,12 @@ def get_swagger_ui_html(
|
||||
if oauth2_redirect_url:
|
||||
html += f"oauth2RedirectUrl: window.location.origin + '{oauth2_redirect_url}',"
|
||||
|
||||
presets = ["SwaggerUIBundle.presets.apis"]
|
||||
if swagger_extra_presets:
|
||||
presets.extend(swagger_extra_presets)
|
||||
presets_str = ",\n ".join(presets)
|
||||
|
||||
html += f"""
|
||||
html += """
|
||||
presets: [
|
||||
{presets_str},
|
||||
SwaggerUIBundle.presets.apis,
|
||||
SwaggerUIBundle.SwaggerUIStandalonePreset
|
||||
],
|
||||
"""
|
||||
|
||||
html += " })"
|
||||
})"""
|
||||
|
||||
if init_oauth:
|
||||
html += f"""
|
||||
|
||||
@@ -18,6 +18,9 @@ def test_swagger_ui():
|
||||
assert "SwaggerUIBundle.presets.apis," in response.text, (
|
||||
"default configs should be preserved"
|
||||
)
|
||||
assert "SwaggerUIBundle.SwaggerUIStandalonePreset" in response.text, (
|
||||
"default configs should be preserved"
|
||||
)
|
||||
assert '"layout": "BaseLayout",' in response.text, (
|
||||
"default configs should be preserved"
|
||||
)
|
||||
|
||||
@@ -21,6 +21,9 @@ def test_swagger_ui():
|
||||
assert "SwaggerUIBundle.presets.apis," in response.text, (
|
||||
"default configs should be preserved"
|
||||
)
|
||||
assert "SwaggerUIBundle.SwaggerUIStandalonePreset" in response.text, (
|
||||
"default configs should be preserved"
|
||||
)
|
||||
assert '"layout": "BaseLayout",' in response.text, (
|
||||
"default configs should be preserved"
|
||||
)
|
||||
|
||||
@@ -24,6 +24,9 @@ def test_swagger_ui():
|
||||
assert "SwaggerUIBundle.presets.apis," in response.text, (
|
||||
"default configs should be preserved"
|
||||
)
|
||||
assert "SwaggerUIBundle.SwaggerUIStandalonePreset" in response.text, (
|
||||
"default configs should be preserved"
|
||||
)
|
||||
assert '"layout": "BaseLayout",' in response.text, (
|
||||
"default configs should be preserved"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user