Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⬆ Update starlette requirement from <0.28.0,>=0.27.0 to >=0.27.0,<0.32.0 #9939

Closed

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Jul 25, 2023

Updates the requirements on starlette to permit the latest version.

Release notes

Sourced from starlette's releases.

Version 0.31.0

Added

  • Officially support Python 3.12 #2214.
  • Support AnyIO 4.0 #2211.
  • Strictly type annotate Starlette (strict mode on mypy) #2180.

Fixed

  • Don't group duplicated headers on a single string when using the TestClient #2219.

Full Changelog: encode/starlette@0.30.0...0.31.0

Changelog

Sourced from starlette's changelog.

0.31.0

July 24, 2023

Added

  • Officially support Python 3.12 #2214.
  • Support AnyIO 4.0 #2211.
  • Strictly type annotate Starlette (strict mode on mypy) #2180.

Fixed

  • Don't group duplicated headers on a single string when using the TestClient #2219.

0.30.0

July 13, 2023

Removed

  • Drop Python 3.7 support #2178.

0.29.0

July 13, 2023

Added

  • Add follow_redirects parameter to TestClient #2207.
  • Add __str__ to HTTPException and WebSocketException #2181.
  • Warn users when using lifespan together with on_startup/on_shutdown #2193.
  • Collect routes from Host to generate the OpenAPI schema #2183.
  • Add request argument to TemplateResponse #2191.

Fixed

  • Stop body_stream in case more_body=False on BaseHTTPMiddleware #2194.

0.28.0

June 7, 2023

Changed

  • Reuse Request's body buffer for call_next in BaseHTTPMiddleware #1692.
  • Move exception handling logic to Route #2026.

Added

  • Add env parameter to Jinja2Templates, and deprecate **env_options #2159.
  • Add clear error message when httpx is not installed #2177.

... (truncated)

Commits

You can trigger a rebase of this PR by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Note
Automatic rebases have been disabled on this pull request as it has been open for over 30 days.

@dependabot dependabot bot added dependencies Pull requests that update a dependency file python Pull requests that update Python code labels Jul 25, 2023
Updates the requirements on [starlette](https://github.com/encode/starlette) to permit the latest version.
- [Release notes](https://github.com/encode/starlette/releases)
- [Changelog](https://github.com/encode/starlette/blob/master/docs/release-notes.md)
- [Commits](encode/starlette@0.27.0...0.31.0)

---
updated-dependencies:
- dependency-name: starlette
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
@ericbuehl
Copy link

@dependabot rebase

@dependabot @github
Copy link
Contributor Author

dependabot bot commented on behalf of github Aug 22, 2023

Sorry, only users with push access can use that command.

@musicinmybrain
Copy link
Contributor

Related: #9636

@longma8520
Copy link

When will this pull request be merged?

@iwanbolzern
Copy link

Hi all,

Thank you for your great work on fastapi!

We're facing the issue right now that with the release of anyio 4 yesterday and the current dependency tree of:

fastapi 0.103.0 FastAPI framework, high performance, easy to learn, fast to code, ready for production
├── pydantic >=1.7.4,<1.8 || >1.8,<1.8.1 || >1.8.1,<2.0.0 || >2.0.0,<2.0.1 || >2.0.1,<2.1.0 || >2.1.0,<3.0.0
│   ├── ...
├── starlette >=0.27.0,<0.28.0
│   └── anyio >=3.4.0,<5
│       ├── idna >=2.8
│       └── sniffio >=1.1
└── typing-extensions >=4.5.0

where starlette 0.27.x has anyio <5 as dependency but only starlette==0.31.0 officially supports anyio 4.

The error we get is:

During handling of the above exception, another exception occurred:

  + Exception Group Traceback (most recent call last):
  |   File "C:\Projects\xxx\common\error.py", line 212, in dispatch
  |     response = await call_next(request)
  |                ^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "C:\Projects\xxx\.venv\Lib\site-packages\starlette\middleware\base.py", line 84, in call_next
  |     raise app_exc
  |   File "C:\Projects\xxx\.venv\Lib\site-packages\starlette\middleware\base.py", line 70, in coro
  |     await self.app(scope, receive_or_disconnect, send_no_error)
  |   File "C:\Projects\xxx\.venv\Lib\site-packages\starlette\middleware\base.py", line 106, in __call__
  |     async with anyio.create_task_group() as task_group:
  |   File "C:\Projects\xxx\.venv\Lib\site-packages\anyio\_backends\_asyncio.py", line 664, in __aexit__
  |     raise BaseExceptionGroup(
  | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
  +-+---------------- 1 ----------------

Does anyone know if someone is actively working on this?

@a410202049
Copy link

How long will it take to upgrade to Starlette 0.31.1?

@steve148
Copy link

Took a look at the failing test, writing my notes for whoever looks at this next.

Test that I saw failing locally was test_dependency_gets_exception. The test was not catching the HTTPException in the Depends function as it did previously. It looks like Starlette 0.28.0 included a change for exception handling which is causing the change (PR linked below). I haven't gone much further than this, but it seems like wrap_app_handling_exceptions swallows the error and it never reaches the depends function.

encode/starlette#2026

https://github.com/encode/starlette/blob/da7adf246de5495b154b45e32d6fa95e181993d8/starlette/_exception_handler.py#L25

@Kludex Kludex closed this Dec 27, 2023
Copy link
Contributor Author

dependabot bot commented on behalf of github Dec 27, 2023

OK, I won't notify you again about this release, but will get in touch when a new version is available. If you'd rather skip all updates until the next major or minor version, let me know by commenting @dependabot ignore this major version or @dependabot ignore this minor version. You can also ignore all major, minor, or patch releases for a dependency by adding an ignore condition with the desired update_types to your config file.

If you change your mind, just re-open this PR and I'll resolve any conflicts on it.

@dependabot dependabot bot deleted the dependabot/pip/starlette-gte-0.27.0-and-lt-0.32.0 branch December 27, 2023 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file internal python Pull requests that update Python code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants