factset / quart-openapi

Module for Quart to add Flask-RESTPlus like functionality
https://factset.github.io/quart-openapi/
Other
82 stars 22 forks source link

cannot import name '_rule_re' from 'werkzeug.routing' #58

Open YaoJusheng opened 2 years ago

YaoJusheng commented 2 years ago

In my code, it has a similar error. By the way, the quart-openapi version I used is 1.7.2 with the version of quart is 0.18.0.

The error message is as follows:

...
  from werkzeug.routing import _rule_re as ROUTE_VAR_RE
ImportError: cannot import name '_rule_re' from 'werkzeug.routing' ...

Originally posted by @YaoJusheng in https://github.com/factset/quart-openapi/issues/38#issuecomment-1233118059

davidavdav commented 2 years ago

I hit the same issue. It is probably not wise to import an object starting with _ from another library, this is probably meant as private

cliftbar commented 1 year ago

+1 to issue. I think this is the commit in werkzeug that refactored the routing module https://github.com/pallets/werkzeug/commit/88125beebc6463e571cef3ca84eccfad0c818ae3. it looks like some of the names and re patterns have changed since then also.

tropxy commented 1 year ago

I have the same issue... is there any update on this? thanks in advance

tropxy commented 1 year ago

my current workaround was to downgrage:

[tool.poetry.dependencies]
python = "^3.10"
quart = "0.17.0"
quart-cors = "0.5.0"
swagger-ui-py = "22.7.13"
quart-openapi = "1.7.2"
flask-sqlalchemy = "2.5.1"
werkzeug = "2.1.2"
aiohttp = "3.8.3"

quart to 0.17.0 flask-sqlalchemy to 2.5.1 werkzeug to 2.1.2 quart-cors to 0.5.0

fuzzy-tribble commented 1 year ago

+1

Madchristian commented 1 year ago

+1

takizuki commented 1 year ago

replace swagger.py line 14 from werkzeug.routing import _rule_re as ROUTE_VAR_RE => from werkzeug.routing.rules import _part_re as ROUTE_VAR_RE

it works with werkzeug 3.0.1