Skip to content

Commit

Permalink
Merge branch 'master' into allow-multiple-levels-of-custom-root-models
Browse files Browse the repository at this point in the history
  • Loading branch information
tiangolo committed Nov 27, 2022
2 parents 5dbd3fa + 99d8470 commit f9681ba
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 10 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/smokeshow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ jobs:
- uses: actions/setup-python@v4
with:
python-version: '3.9'
cache: "pip"
cache-dependency-path: pyproject.toml

- run: pip install smokeshow

Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ repos:
- --py3-plus
- --keep-runtime-typing
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.114
rev: v0.0.138
hooks:
- id: ruff
args:
Expand Down
3 changes: 3 additions & 0 deletions docs/en/docs/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Latest Changes

* ⬆️ Upgrade Ruff. PR [#5698](https://github.com/tiangolo/fastapi/pull/5698) by [@tiangolo](https://github.com/tiangolo).
* 👷 Remove pip cache for Smokeshow as it depends on a requirements.txt. PR [#5700](https://github.com/tiangolo/fastapi/pull/5700) by [@tiangolo](https://github.com/tiangolo).
* 💚 Fix pip cache for Smokeshow. PR [#5697](https://github.com/tiangolo/fastapi/pull/5697) by [@tiangolo](https://github.com/tiangolo).
* 👷 Fix and tweak CI cache handling. PR [#5696](https://github.com/tiangolo/fastapi/pull/5696) by [@tiangolo](https://github.com/tiangolo).
* 👷 Update `setup-python` action in tests to use new caching feature. PR [#5680](https://github.com/tiangolo/fastapi/pull/5680) by [@madkinsz](https://github.com/madkinsz).
* ✏️ Fix typo in docs for `docs/en/docs/advanced/middleware.md`. PR [#5376](https://github.com/tiangolo/fastapi/pull/5376) by [@rifatrakib](https://github.com/rifatrakib).
Expand Down
4 changes: 2 additions & 2 deletions fastapi/dependencies/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ def check_file_field(field: ModelField) -> None:
assert parse_options_header
except ImportError:
logger.error(multipart_incorrect_install_error)
raise RuntimeError(multipart_incorrect_install_error)
raise RuntimeError(multipart_incorrect_install_error) from None
except ImportError:
logger.error(multipart_not_installed_error)
raise RuntimeError(multipart_not_installed_error)
raise RuntimeError(multipart_not_installed_error) from None


def get_param_sub_dependant(
Expand Down
2 changes: 1 addition & 1 deletion fastapi/encoders.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def jsonable_encoder(
data = vars(obj)
except Exception as e:
errors.append(e)
raise ValueError(errors)
raise ValueError(errors) from e
return jsonable_encoder(
data,
include=include,
Expand Down
2 changes: 1 addition & 1 deletion fastapi/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def create_response_field(
except RuntimeError:
raise fastapi.exceptions.FastAPIError(
f"Invalid args for response field! Hint: check that {type_} is a valid pydantic field type"
)
) from None


def create_cloned_field(
Expand Down
8 changes: 5 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ test = [
"pytest >=7.1.3,<8.0.0",
"coverage[toml] >= 6.5.0,<7.0",
"mypy ==0.982",
"ruff ==0.0.114",
"ruff ==0.0.138",
"black == 22.10.0",
"isort >=5.0.6,<6.0.0",
"httpx >=0.23.0,<0.24.0",
Expand Down Expand Up @@ -87,7 +87,7 @@ doc = [
"pyyaml >=5.3.1,<7.0.0",
]
dev = [
"ruff ==0.0.114",
"ruff ==0.0.138",
"uvicorn[standard] >=0.12.0,<0.19.0",
"pre-commit >=2.17.0,<3.0.0",
]
Expand Down Expand Up @@ -168,6 +168,7 @@ select = [
ignore = [
"E501", # line too long, handled by black
"B008", # do not perform function calls in argument defaults
"C901", # too complex
]

[tool.ruff.per-file-ignores]
Expand All @@ -178,7 +179,8 @@ ignore = [
"docs_src/dependencies/tutorial010.py" = ["F821"]
"docs_src/custom_response/tutorial007.py" = ["B007"]
"docs_src/dataclasses/tutorial003.py" = ["I001"]

"docs_src/path_operation_advanced_configuration/tutorial007.py" = ["B904"]
"docs_src/custom_request_and_route/tutorial002.py" = ["B904"]

[tool.ruff.isort]
known-third-party = ["fastapi", "pydantic", "starlette"]

0 comments on commit f9681ba

Please sign in to comment.