Skip to content
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

Lock flask version #2516

Closed
wants to merge 2 commits into from
Closed

Lock flask version #2516

wants to merge 2 commits into from

Conversation

T4rk1n
Copy link
Contributor

@T4rk1n T4rk1n commented Apr 28, 2023

Recent versions of flask/werkzeug have introduced breaking bugs in dash. This PR lock the versions of flask/werkzeug installed in order to prevent further breakage.

@alexcjohnson
Copy link
Collaborator

Forum post discussing the motivations for this PR: https://community.plotly.com/t/dash-is-planning-to-lock-flask-werkzeug-versions/74829

@moorepants
Copy link
Contributor

I saw the recent forum post and just wanted to express that I don't think this is a good idea. The general reason is explained in this blog post: https://iscinumpy.dev/post/bound-version-constraints/. Dash is used as a library when we build applications and we need to be able to mix versions of dependencies as flexibly as possible. Making a decision like this may seem like a good idea from the perspective of a dash developer, but for users it will cause headaches. I think a better approach is to use the same >= pin you used before but bump the version of flask up and make dash robust to a set of flask versions. I maintain the dash conda package and this will also make it virtually impossible to install dash alongside other packages that depend on flask.

@alexcjohnson
Copy link
Collaborator

Thanks @moorepants - I pointed to exactly that post last year in plotly/jupyter-dash#87 (comment) when this same issue came up with Flask/Werkzeug 2.1. We've really tried hard to stick to that stance, but it's now been three minor versions in a row that caused different breaking changes for Dash. We need to acknowledge that the great majority of Dash users don't care what version of Flask they're using - many don't even know they're using Flask. So this is causing lots of users' code to break unnecessarily, causing us ongoing headaches trying to help them and scramble to update our code, and only helping the small fraction of Dash users who use Dash within another Flask app.

We're investigating what we can do to make life easier for our majority use case while still allowing Flask to float for the Dash-in-a-Flask-app use case (with the caveat that you're on your own if you end up with a version different from the officially supported one). It might mean a separate package (dash-core?) that doesn't pin Flask, while the primary dash package does. We're open to any ideas you have, but one way or another the status quo is not sustainable.

@moorepants
Copy link
Contributor

The idea I have is to follow the same method as most all other Python libraries. Pin with >= and if a new release of a dependency breaks Dash, then update Dash to deal with the change. If a Dash user experiences a break when they update dependencies in their environment, then they can make an == or <= pin there until Dash is patched. If Dash users don't want their app to break, they shouldn't update dependencies.

@alexcjohnson
Copy link
Collaborator

That’s exactly what we have been doing until now. But with regards to Flask specifically that philosophy is not working.

@T4rk1n
Copy link
Contributor Author

T4rk1n commented May 23, 2023

Closing in favor of #2538

@T4rk1n T4rk1n closed this May 23, 2023
@T4rk1n T4rk1n deleted the lock-flask branch May 23, 2023 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants