-
Notifications
You must be signed in to change notification settings - Fork 333
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
Unpin Flask and Werkzeug #313
Comments
We are using flask-restx for quite a while, I like the idea of werkzeug 2.0 with flask-restx because of the upload speed. There is improvement in werkzeug for parsing uploaded files faster and since we could not benefited from that. We used some 3rd party parser. Is there any beginner issue or clear thing to do that I could do to help speed up the transition? |
@hbusul : the first place to start is running pulling the latest code for flask-restx, unpinning flask and werkzeug, and seeing what errors pop up. We also need to compare local outputs to what the Github Actions showed us: https://github.com/python-restx/flask-restx/runs/2565726592 finally, it'd be very worthwhile if folks are willing / able to manually upgrade flask and werkzeug on testing setups and see if any other errors bubble from common use cases. |
I will run our internal tests with latest commit(not latest release?) with werkzeug 2.0 and pinpoint the warnings and errors then. I remember tests failing for the werkzeug rc, they probably will fail for 2.0 as well. |
I am now using latest versions of the Pallets projects with flask-restx 0.4.0. |
Even with flask-restx 0.4.0, having Flask 2.0.0 and Werkzeug 2.0.0 causes build/runtime issues like shown below. We had to pin the Flask to 1.1.2 and Werkzeug to 1.0.1 versions to resolve this. Could this be addressed in the next release? /flask_restx/api.py", line 20, in |
@kannanprasanna they fixed it in the master branch, I guess it will be addressed in the next release.
|
When you are planning to release this fix? |
Any updates? |
Signed-off-by: Paulo Vital <paulo@vital.eng.br>
Signed-off-by: Paulo Vital <paulo@vital.eng.br>
…tead of BaseResponse
Any updates? |
@j5awry any updates? |
#313 don't use werkzeug, flask 2.0.0 and use Response instead of BaseResponse. Contrib: hbusul reviewer: j5awry
#341 has been merged. At the moment that looks like the only Flask and Werkzeug changes absolutely required. I'm going to let it marinate on main for a little while though. If teams can pull from main and give the code a try in their environments to ensure everything is working appropriately, I'll put a release together. What I don't want is to merge this in and break a lot of people. As you can tell, we're small and community driven (most folks making contributions are not maintainers at this point). That means response can be a bit slower when it comes to changes. I'm happy we were able to limit how many people got "broken" when flask rolled, and don't want to further break anyone when we unpin. NOTE: If you're working in production, you should be freezing your deps. That means picking the versions of Flask and Werkzeug compatible with everything you do. we have tried to be as loosely pinned as possible and leave it to end-users. Double-edged sword there. |
Thank you @j5awry! I just tested the updated package and it works for me (important caveat: the tool I'm using it in is very fresh, and it's not in prod yet). For the ones reading this issue and willing to give it a try, the easiest way is as follows (simply installing the repository doesn't work as you will be missing the swagger assets):
|
One more thing: would it make sense to make a pre-release (https://packaging.python.org/guides/distributing-packages-using-setuptools/#pre-release-versioning)? |
Until the release, install restx this way: python-restx/flask-restx#313 (comment)
I think it's safe to just release and work through things. At this point, teams should have already pinned Flask and Werkzeug (hopefully). They can unprev Flask and Werkzeug in a test environment after a release. and if there are still issues, we can work through them and try to push patch releases quickly. |
This solution definitely work for me :) |
@j5awry is there an expected release date for the support of flask 2.0.1 and above? |
on version 0.5.0, flask has been unpinned |
Is your feature request related to a problem? Please describe.
on 20210511, Flask and werkzeug released version 2.0.0. Flask had some API changes which led to breaks, but the community quickly found at least one. There's an upstream bug report in werkzeug that our tests are catching as well:
at least one is related to something report upstream to werkzeug: pallets/werkzeug#2115
We should do dependency upgrades and checks for Flask and werkzeug, run tests, see if any other errors occur in environments, and see what other issues arise in some integration tests.
Describe the solution you'd like
unpin flask and werkzeug
Describe alternatives you've considered
I refuse alternatives! As a maintainer, I maintain that right :P but, really, we should update tests and code as required for it to work. we do not want to stay pinned to lower versions as Flask and werkzeug merrily roll along.
Additional context
Pin PR: #311 311
PR to fix at least one Flask API change: #309
Original issue tracking the Flask API change: #308
The text was updated successfully, but these errors were encountered: