Skip to content

Commit

Permalink
Merge branch 'tiangolo:master' into de/docs/tutorial/dependencies/cla…
Browse files Browse the repository at this point in the history
…sses-as-dependencies.md
  • Loading branch information
nilslindemann committed Oct 17, 2023
2 parents 21d4204 + 3fa44aa commit 446476b
Show file tree
Hide file tree
Showing 127 changed files with 675 additions and 672 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-docs.yml
Expand Up @@ -17,7 +17,7 @@ jobs:
outputs:
docs: ${{ steps.filter.outputs.docs }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
# For pull requests it's not necessary to checkout the code but for master it is
- uses: dorny/paths-filter@v2
id: filter
Expand All @@ -35,7 +35,7 @@ jobs:
outputs:
langs: ${{ steps.show-langs.outputs.langs }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
Expand Down Expand Up @@ -71,7 +71,7 @@ jobs:
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy-docs.yml
Expand Up @@ -14,14 +14,14 @@ jobs:
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Clean site
run: |
rm -rf ./site
mkdir ./site
- name: Download Artifact Docs
id: download
uses: dawidd6/action-download-artifact@v2.27.0
uses: dawidd6/action-download-artifact@v2.28.0
with:
if_no_artifact_found: ignore
github_token: ${{ secrets.FASTAPI_PREVIEW_DOCS_DOWNLOAD_ARTIFACTS }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/latest-changes.yml
Expand Up @@ -24,7 +24,7 @@ jobs:
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
# To allow latest-changes to commit to the main branch
token: ${{ secrets.FASTAPI_LATEST_CHANGES }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/notify-translations.yml
Expand Up @@ -23,7 +23,7 @@ jobs:
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v3
- uses: actions/checkout@v4
# Allow debugging with tmate
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/people.yml
Expand Up @@ -19,7 +19,7 @@ jobs:
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v3
- uses: actions/checkout@v4
# Ref: https://github.com/actions/runner/issues/2033
- name: Fix git safe.directory in container
run: mkdir -p /home/runner/work/_temp/_github_home && printf "[safe]\n\tdirectory = /github/workspace" > /home/runner/work/_temp/_github_home/.gitconfig
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Expand Up @@ -13,11 +13,11 @@ jobs:
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.7"
python-version: "3.10"
# Issue ref: https://github.com/actions/setup-python/issues/436
# cache: "pip"
cache-dependency-path: pyproject.toml
Expand All @@ -32,7 +32,7 @@ jobs:
- name: Build distribution
run: python -m build
- name: Publish
uses: pypa/gh-action-pypi-publish@v1.8.6
uses: pypa/gh-action-pypi-publish@v1.8.10
with:
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Dump GitHub context
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/smokeshow.yml
Expand Up @@ -24,7 +24,7 @@ jobs:

- run: pip install smokeshow

- uses: dawidd6/action-download-artifact@v2.27.0
- uses: dawidd6/action-download-artifact@v2.28.0
with:
github_token: ${{ secrets.FASTAPI_SMOKESHOW_DOWNLOAD_ARTIFACTS }}
workflow: test.yml
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Expand Up @@ -17,7 +17,7 @@ jobs:
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
Expand All @@ -42,15 +42,15 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
pydantic-version: ["pydantic-v1", "pydantic-v2"]
fail-fast: false
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
Expand Down Expand Up @@ -92,7 +92,7 @@ jobs:
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.8'
Expand Down
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -27,7 +27,7 @@

---

FastAPI is a modern, fast (high-performance), web framework for building APIs with Python 3.7+ based on standard Python type hints.
FastAPI is a modern, fast (high-performance), web framework for building APIs with Python 3.8+ based on standard Python type hints.

The key features are:

Expand Down Expand Up @@ -120,7 +120,7 @@ If you are building a <abbr title="Command Line Interface">CLI</abbr> app to be

## Requirements

Python 3.7+
Python 3.8+

FastAPI stands on the shoulders of giants:

Expand Down Expand Up @@ -336,7 +336,7 @@ You do that with standard modern Python types.

You don't have to learn a new syntax, the methods or classes of a specific library, etc.

Just standard **Python 3.7+**.
Just standard **Python 3.8+**.

For example, for an `int`:

Expand Down
2 changes: 1 addition & 1 deletion docs/de/docs/features.md
Expand Up @@ -25,7 +25,7 @@ Mit einer interaktiven API-Dokumentation und explorativen webbasierten Benutzers

### Nur modernes Python

Alles basiert auf **Python 3.6 Typ**-Deklarationen (dank Pydantic). Es muss keine neue Syntax gelernt werden, nur standardisiertes modernes Python.
Alles basiert auf **Python 3.8 Typ**-Deklarationen (dank Pydantic). Es muss keine neue Syntax gelernt werden, nur standardisiertes modernes Python.



Expand Down
4 changes: 2 additions & 2 deletions docs/en/docs/advanced/additional-status-codes.md
Expand Up @@ -26,7 +26,7 @@ To achieve that, import `JSONResponse`, and return your content there directly,
{!> ../../../docs_src/additional_status_codes/tutorial001_an_py39.py!}
```

=== "Python 3.6+"
=== "Python 3.8+"

```Python hl_lines="4 26"
{!> ../../../docs_src/additional_status_codes/tutorial001_an.py!}
Expand All @@ -41,7 +41,7 @@ To achieve that, import `JSONResponse`, and return your content there directly,
{!> ../../../docs_src/additional_status_codes/tutorial001_py310.py!}
```

=== "Python 3.6+ non-Annotated"
=== "Python 3.8+ non-Annotated"

!!! tip
Prefer to use the `Annotated` version if possible.
Expand Down
16 changes: 8 additions & 8 deletions docs/en/docs/advanced/advanced-dependencies.md
Expand Up @@ -24,13 +24,13 @@ To do that, we declare a method `__call__`:
{!> ../../../docs_src/dependencies/tutorial011_an_py39.py!}
```

=== "Python 3.6+"
=== "Python 3.8+"

```Python hl_lines="11"
{!> ../../../docs_src/dependencies/tutorial011_an.py!}
```

=== "Python 3.6+ non-Annotated"
=== "Python 3.8+ non-Annotated"

!!! tip
Prefer to use the `Annotated` version if possible.
Expand All @@ -51,13 +51,13 @@ And now, we can use `__init__` to declare the parameters of the instance that we
{!> ../../../docs_src/dependencies/tutorial011_an_py39.py!}
```

=== "Python 3.6+"
=== "Python 3.8+"

```Python hl_lines="8"
{!> ../../../docs_src/dependencies/tutorial011_an.py!}
```

=== "Python 3.6+ non-Annotated"
=== "Python 3.8+ non-Annotated"

!!! tip
Prefer to use the `Annotated` version if possible.
Expand All @@ -78,13 +78,13 @@ We could create an instance of this class with:
{!> ../../../docs_src/dependencies/tutorial011_an_py39.py!}
```

=== "Python 3.6+"
=== "Python 3.8+"

```Python hl_lines="17"
{!> ../../../docs_src/dependencies/tutorial011_an.py!}
```

=== "Python 3.6+ non-Annotated"
=== "Python 3.8+ non-Annotated"

!!! tip
Prefer to use the `Annotated` version if possible.
Expand Down Expand Up @@ -113,13 +113,13 @@ checker(q="somequery")
{!> ../../../docs_src/dependencies/tutorial011_an_py39.py!}
```

=== "Python 3.6+"
=== "Python 3.8+"

```Python hl_lines="21"
{!> ../../../docs_src/dependencies/tutorial011_an.py!}
```

=== "Python 3.6+ non-Annotated"
=== "Python 3.8+ non-Annotated"

!!! tip
Prefer to use the `Annotated` version if possible.
Expand Down
6 changes: 3 additions & 3 deletions docs/en/docs/advanced/generate-clients.md
Expand Up @@ -35,7 +35,7 @@ Let's start with a simple FastAPI application:
{!> ../../../docs_src/generate_clients/tutorial001_py39.py!}
```

=== "Python 3.6+"
=== "Python 3.8+"

```Python hl_lines="9-11 14-15 18 19 23"
{!> ../../../docs_src/generate_clients/tutorial001.py!}
Expand Down Expand Up @@ -147,7 +147,7 @@ For example, you could have a section for **items** and another section for **us
{!> ../../../docs_src/generate_clients/tutorial002_py39.py!}
```

=== "Python 3.6+"
=== "Python 3.8+"

```Python hl_lines="23 28 36"
{!> ../../../docs_src/generate_clients/tutorial002.py!}
Expand Down Expand Up @@ -204,7 +204,7 @@ You can then pass that custom function to **FastAPI** as the `generate_unique_id
{!> ../../../docs_src/generate_clients/tutorial003_py39.py!}
```

=== "Python 3.6+"
=== "Python 3.8+"

```Python hl_lines="8-9 12"
{!> ../../../docs_src/generate_clients/tutorial003.py!}
Expand Down
12 changes: 6 additions & 6 deletions docs/en/docs/advanced/security/http-basic-auth.md
Expand Up @@ -26,13 +26,13 @@ Then, when you type that username and password, the browser sends them in the he
{!> ../../../docs_src/security/tutorial006_an_py39.py!}
```

=== "Python 3.6+"
=== "Python 3.8+"

```Python hl_lines="2 7 11"
{!> ../../../docs_src/security/tutorial006_an.py!}
```

=== "Python 3.6+ non-Annotated"
=== "Python 3.8+ non-Annotated"

!!! tip
Prefer to use the `Annotated` version if possible.
Expand Down Expand Up @@ -65,13 +65,13 @@ Then we can use `secrets.compare_digest()` to ensure that `credentials.username`
{!> ../../../docs_src/security/tutorial007_an_py39.py!}
```

=== "Python 3.6+"
=== "Python 3.8+"

```Python hl_lines="1 12-24"
{!> ../../../docs_src/security/tutorial007_an.py!}
```

=== "Python 3.6+ non-Annotated"
=== "Python 3.8+ non-Annotated"

!!! tip
Prefer to use the `Annotated` version if possible.
Expand Down Expand Up @@ -148,13 +148,13 @@ After detecting that the credentials are incorrect, return an `HTTPException` wi
{!> ../../../docs_src/security/tutorial007_an_py39.py!}
```

=== "Python 3.6+"
=== "Python 3.8+"

```Python hl_lines="26-30"
{!> ../../../docs_src/security/tutorial007_an.py!}
```

=== "Python 3.6+ non-Annotated"
=== "Python 3.8+ non-Annotated"

!!! tip
Prefer to use the `Annotated` version if possible.
Expand Down

0 comments on commit 446476b

Please sign in to comment.