python-restx / flask-restx

Fork of Flask-RESTPlus: Fully featured framework for fast, easy and documented API development with Flask
https://flask-restx.readthedocs.io/en/latest/
Other
2.16k stars 334 forks source link

Flask 3.0.0 #566

Closed Ced1999 closed 2 weeks ago

Ced1999 commented 1 year ago

Ask a question Flask was updated to version 3.0.0. This seems to break compatibility with flask-restx completely on my end. Are there plans to make them compatible again in the future?

Yoshi325 commented 1 year ago

At least one part is being tackled here: https://github.com/python-restx/flask-restx/issues/567

So I'd say there is hope.

Ryu-CZ commented 1 year ago

I made a few patches for major issues, but tool the flask-restx is using to mock test flask compatibility are unfortunately also broken by transition to 3.0. So pull request reviews could take some time. This unfortunately can put also block your projects from integration of flask 3.0. I put a hotfixes to restx-monkey 5.1+ which makes 3.0 flask and flask-restx compatible again so you can test and resolve your own code base compatibilities issues, while flask-restx teams does the same. I hope this could save you some time.

peter-doggart commented 1 year ago

Just pinning this to keep it at the top. It is our intention to update flask-restx to support Flask 3.0.0+ as soon as possible, but it is currently blocked because, as @Ryu-CZ mentioned, we use pytest-flask to mock flask components, and it is also broken by the new Flask version.

Thankfully, the project is still active so hopefully will be fixed shortly. You can follow the discussion here: https://github.com/pytest-dev/pytest-flask/issues/167

safe commented 11 months ago

@peter-doggart Thoughts on pinning flask to < 3.0.0 until this is resolved? I can raise a PR if so.

peter-doggart commented 11 months ago

@safe I've created a PR for this. Can you just run your eye over it and make sure it's all fine? https://github.com/python-restx/flask-restx/pull/579

peter-doggart commented 11 months ago

I have now released flask-restx==1.2.0 which contains restrictions on some version until we can get everything updated (still awaiting pytest-flask updates) so that a default installation isn't broken.

Anyone who wants to make use of restx-monkey can install flask-restx==1.1.0 and then patch which will allow flask >=3.0.0 usage.

nachitox commented 11 months ago

pytest-flask was upgraded yesterday.

peter-doggart commented 11 months ago

@nachitox Great news. I will try and get everything merged over the coming days, pretty flat out with other things this week.

diogper commented 11 months ago

Great news!

peter-doggart commented 11 months ago

I haven't forgotten about this, just got very little time atm. It's still on my to-do list!

peter-doggart commented 10 months ago

Flask-restx community, thanks for your patience on this! :)

I have just merged all the most recent PRs and done some general tidy up. Flask-restx 1.3.0 should hit PyPi in a few minutes. Flask and Werkzeug >=3.0.0 should now work correctly again.

There is still a deprecation warning relating to jsonschema, however it doesn't currently impact functionality. I will hopefully get some time to deep dive on how to fix it over the coming weeks.

Please file a new issue (or PR if you have the time!) if you find anything is broken or funny.

martin-thoma commented 8 months ago

The new version is on PyPI. Should this be closed?