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.14k stars 333 forks source link

Support Werkzeug 3.0 #573

Open funsim opened 11 months ago

funsim commented 11 months ago

https://github.com/python-restx/flask-restx/blob/7ce0ef8056e66d81018e32dfe4b2dcc59dedfb83/flask_restx/api.py#L35-L40

Should be replaced with

from importlib.metadata import version

if version("werkzeug").split(".")[0] >= "2": 
    from werkzeug.wrappers import Response as BaseResponse 
else: 
    from werkzeug.wrappers import BaseResponse 
peter-doggart commented 11 months ago

Good spot, will make sure this gets updated along with the flask 3.0 support things.

Ryu-CZ commented 11 months ago

Switch to importlib #562 is related to this issue. I will check project for other usages of __version__.

For @funsim: flask-restx dropped support of 3.7 python which could cause conflict of package versioning so please check your python version also. But I think werkzeug dropped 3.7 python support too.

emily-coffin commented 9 months ago

Is there any update on this?

peter-doggart commented 9 months ago

@funsim @emily-coffin This should be fixed on v1.3.0 which was released today. Please let me know if it is not. :)

seanieb commented 9 months ago

Thanks for your work here Peter. It's much appreciated.