-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Change get_current_traceback
to DebugTraceback
#1993
Conversation
get_current_traceback
to DebugTraceback
|
get_current_traceback
to DebugTraceback
Flask<2.1.0
to retain Python 3.6 compatibility
Flask<2.1.0
to retain Python 3.6 compatibilityFlask<2.1.0
and Werkzeug<2.1.0
to retain Python 3.6 compatibility
Flask<2.1.0
and Werkzeug<2.1.0
to retain Python 3.6 compatibilityFlask<2.1.0
, Werkzeug<2.1.0
, and click<8.1.0
to retain Python 3.6 compatibility
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Version upper bounds are no good approach for library projects: https://iscinumpy.dev/post/bound-version-constraints/
You should instead write conditional code handling all flask/werkzeug versions or (if that’s too hard) drop Python 3.6 support
@flying-sheep I can do either. I don't see much examples of conditional Python version handling within Dash (only dash/dash/development/component_generator.py Line 154 in 3334c07
Are you one of the maintainers of Dash? Just want to makes sure the change is aligned with whoever will be making the final call. |
I’m not, sorry if I gave the impression. I think you can see that by the color of my review icon: mine is gray, so it’s just a “suggested change” and not a “requested change”. I’m just speaking from my history of dealing with compatibility problems and bugs in python libraries. That blog post I linked really nails it IMHO, and I think any library maintainer should read it. Upper version bounds just cause too many problems for too many people. |
No worries, and thanks for the article link--I've been going through it and sharing it to my colleagues, since there's a lot of great stuff with examples in there!! |
I think we can drop support for Python 3.6 in later releases, it's been end of life for a few months now and more libraries will stop working as they drop support. What do you think @alexcjohnson ? |
Py3.6 still accounts for about 10% of our downloads so I don't think it's time to drop it yet. 3.7 is still the most used though it's about to lose that title to 3.8 finally. |
Flask<2.1.0
, Werkzeug<2.1.0
, and click<8.1.0
to retain Python 3.6 compatibilityget_current_traceback
to DebugTraceback
Fix for ImportError: cannot import name 'get_current_traceback' from 'werkzeug.debug.tbtools' conflict with dash for studio celery-beat | from .dash_demo import app celery-beat | File "/app/monitor/dash_demo.py", line 8, in <module> celery-beat | import dash celery-beat | File "/usr/local/lib/python3.8/site-packages/dash/__init__.py", line 5, in <module> celery-beat | from .dash import Dash, no_update # noqa: F401,E402 celery-beat | File "/usr/local/lib/python3.8/site-packages/dash/dash.py", line 22, in <module> celery-beat | from werkzeug.debug.tbtools import get_current_traceback celery-beat | ImportError: cannot import name 'get_current_traceback' from 'werkzeug.debug.tbtools' (/usr/local/lib/python3.8/site-packages/werkzeug/debug/tbtools.py) Ref: plotly/dash#1993
Fix for ImportError: cannot import name 'get_current_traceback' from 'werkzeug.debug.tbtools' conflict with dash for studio celery-beat | from .dash_demo import app celery-beat | File "/app/monitor/dash_demo.py", line 8, in <module> celery-beat | import dash celery-beat | File "/usr/local/lib/python3.8/site-packages/dash/__init__.py", line 5, in <module> celery-beat | from .dash import Dash, no_update # noqa: F401,E402 celery-beat | File "/usr/local/lib/python3.8/site-packages/dash/dash.py", line 22, in <module> celery-beat | from werkzeug.debug.tbtools import get_current_traceback celery-beat | ImportError: cannot import name 'get_current_traceback' from 'werkzeug.debug.tbtools' (/usr/local/lib/python3.8/site-packages/werkzeug/debug/tbtools.py) Ref: plotly/dash#1993
Thanks @deepyaman - we ended up going with #1995 so I'll close this one but your work here was helpful toward fully understanding the issue! |
Fix for ImportError: cannot import name 'get_current_traceback' from 'werkzeug.debug.tbtools' conflict with dash for studio celery-beat | from .dash_demo import app celery-beat | File "/app/monitor/dash_demo.py", line 8, in <module> celery-beat | import dash celery-beat | File "/usr/local/lib/python3.8/site-packages/dash/__init__.py", line 5, in <module> celery-beat | from .dash import Dash, no_update # noqa: F401,E402 celery-beat | File "/usr/local/lib/python3.8/site-packages/dash/dash.py", line 22, in <module> celery-beat | from werkzeug.debug.tbtools import get_current_traceback celery-beat | ImportError: cannot import name 'get_current_traceback' from 'werkzeug.debug.tbtools' (/usr/local/lib/python3.8/site-packages/werkzeug/debug/tbtools.py) Reproduce the error: 1- Install stackn (docker-compose up) Ref: plotly/dash#1993
Closes #1992
It's not an option to change
get_current_traceback
toDebugTraceback
entirely becauseWerkzeug==2.1.0
requires Python 3.7, but we can backport a minimalDebugTraceback
to earlier versions of Werkzeug.Contributor Checklist
optionals
CHANGELOG.md