Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Bug: Breaking change in new release of Starlette #2342

Closed
miguescri opened this issue Nov 10, 2020 · 14 comments
Closed

Bug: Breaking change in new release of Starlette #2342

miguescri opened this issue Nov 10, 2020 · 14 comments

Comments

@miguescri
Copy link

Yesterday, Starlette 0.14.1 was released, which removes UJSONResponse. As a result,

from starlette.responses import UJSONResponse # noqa
breaks on start-up.

@ycd
Copy link
Contributor

ycd commented Nov 10, 2020

Here is the related PR #2335

@miguescri
Copy link
Author

Thank you for the pointer @ycd .

I'll keep the issue open until the PR merges, for reference for users whose servers break (like mine did).

@mezhaka
Copy link

mezhaka commented Dec 2, 2020

What's the smartest thing to do here?
I use conda to create my environment and I have currently pinned starlette==0.13.8, which seems to help.

@Kludex
Copy link
Sponsor Collaborator

Kludex commented Dec 2, 2020

@mezhaka Not importing starlette directly on your requirements 🤔

@miguescri
Copy link
Author

Yes, until #2335 merges, the Starlette version needs to be pinned to <0.14.1 if you have it in your requirements.

@Kludex , for most people that will do. But it is worth noting that may not be an option if you directly use some of Startlette's elements and need to have an updated version. Keep in mind that right now FastAPI installs by default Starlette 0.13.6, which is 4 releases behind master.

@mezhaka
Copy link

mezhaka commented Dec 3, 2020

@Kludex @miguescri I did not have explicit Starlette in my environment and this way the app was broken. As I have added it explicitly -- it runs.

@Mause
Copy link
Contributor

Mause commented Dec 3, 2020

Which package manager are you using? If you don't add an explicit dependency version, it should automatically install a compatible version

@miguescri
Copy link
Author

@mezhaka are you using a virtual env or a system wide installation? And are you using a Python package manager or you installed some of the Python packages from your distro's repositories?

@mezhaka
Copy link

mezhaka commented Dec 3, 2020

@Mause @miguescri I use conda. I have an environment.yml file which looks something like this (I've removed some packages):

name: myapp
channels:
  - conda-forge
  - mycompany
dependencies:
  - python~=3.7
  - pymongo~=3.10
  - gunicorn~=20.0
  - uvicorn~=0.11
  - fastapi~=0.60
  - pydantic~=1.6

I then create environments with conda env create -f env.yml, activate it conda env activate myapp, and start my python web app.
As soon as I've added - starlette==0.13.8 to this list -- the error went away.

@ycd
Copy link
Contributor

ycd commented Dec 7, 2020

Btw, i'm still not sure this error is an expected behaviour, because in our pyproject.toml

"starlette ==0.13.6",

Starlette pinned to the 0.13.6, so it shouldn't be installing the 0.14.1.

@maresb
Copy link

maresb commented Dec 12, 2020

I also ran into problems with my Conda environment. FastAPI pins starlette-base to 0.13.6 but starlette itself is unpinned.

I reported it to the feedstock here:
conda-forge/fastapi-feedstock#43

@miguescri
Copy link
Author

#2335 has been merged.

@tiangolo
Copy link
Owner

Thanks for the help here everyone! 👏 🙇

Thanks for reporting back and closing the issue @miguescri 👍

Sorry for the long delay! 🙈 I wanted to personally address each issue/PR and they piled up through time, but now I'm checking each one in order.

@github-actions
Copy link
Contributor

Assuming the original need was handled, this will be automatically closed now. But feel free to add more comments or create new issues or PRs.

@tiangolo tiangolo reopened this Feb 28, 2023
Repository owner locked and limited conversation to collaborators Feb 28, 2023
@tiangolo tiangolo converted this issue into discussion #7024 Feb 28, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests

7 participants