Skip to content

Conversation

chrisinmtown
Copy link
Contributor

@chrisinmtown chrisinmtown commented Jun 18, 2025

Add minimum-version tox env using Python 3.9
Upgrade minimum versions of libraries
Restore tox pre-commit checks

Per requests from the community, this change keeps Flask v2

@chrisinmtown
Copy link
Contributor Author

chrisinmtown commented Jun 18, 2025

I was very pleasantly surprised that there were no dependency conflicts when using versions Flask 2.3.3 and Werkzeug 3.1.3, and that all the tox tests passed. Please comment on problems that you spot here.

@mfmarche please review

Copy link
Contributor

@mfmarche mfmarche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@chrisinmtown
Copy link
Contributor Author

I've been trying to restore the min-version tests. If I specify Flask >= 2.2.0, that test uses Flask version 2.2.0 and tox emits this failure:

.tox/py39-min/lib/python3.9/site-packages/flask/app.py:29: in <module>
    from werkzeug.urls import url_quote
E   ImportError: cannot import name 'url_quote' from 'werkzeug.urls' 

Also see: https://stackoverflow.com/questions/77213053/why-did-flask-start-failing-with-importerror-cannot-import-name-url-quote-fr

I hit similar problems with Flask 2.3.0, 2.3.1 and 2.3.2. The oldest Flask version that works on this branch right now seems to be 2.3.3.

I know this is a Python project, but trying to figure this out feels like DLL hell :) Please comment if you see something I'm missing about how to use Flask 2.2.x, or < 2.3.3.

@mfmarche
Copy link
Contributor

@chrisinmtown , A suggestion is to restrict to flask to >=2.3.3. As per https://github.com/pallets/flask/releases:

"Note that 2.3.x is the currently supported release branch; please upgrade to the latest version if possible."

Having to add further restrictions to werkzeug versioning is not ideal.

@chrisinmtown
Copy link
Contributor Author

chrisinmtown commented Jun 18, 2025

I think this PR achieves the goal of allowing current projects that use Connexion v2 to stay on Flask 2.x as requested by many people who commented on PR #1992. I'm concerned that my updates to other library versions (like Jinja2) will cause grief. I hope the community and especially the maintainers will review and comment.

Add minimum-version tox env using Python 3.9
Upgrade version of Jinja2 library to meet Flask minimum
Restore tox pre-commit checks
@potiuk
Copy link

potiuk commented Jun 18, 2025

That's cool. Thank you for all the efforts on that @chrisinmtown

@potiuk
Copy link

potiuk commented Jun 18, 2025

As discused in #1992 -> Flask 2.3.3 should be fine for us in Airflow!

@chrisinmtown
Copy link
Contributor Author

greetings @RobbeSneyders and @Ruwann will you please consider this change? If you publish a new pre-release candidate with this change then more people in the V2 community can test against their projects. Thanks in advance.

Copy link
Member

@Ruwann Ruwann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the efforts, @chrisinmtown !

Nice to hear that it works for both flask v2 and v3.

@Ruwann Ruwann merged commit 4d0a288 into spec-first:v2 Jun 22, 2025
8 checks passed
@potiuk
Copy link

potiuk commented Jun 22, 2025

Wooho!! I see we have rc2 - let me test it with Airflow 2!

@chrisinmtown
Copy link
Contributor Author

chrisinmtown commented Jun 22, 2025

Thanks @Ruwann.

What is your release process - how do you decide when to promote rc2 from pre-release to real release?

@chrisinmtown chrisinmtown deleted the v2-keep-flask-2 branch June 22, 2025 10:10
@chrisinmtown
Copy link
Contributor Author

Bump, please forgive me for nagging y'all: @ykharko @noirbee @hehe7318 @gmarciani @sebastien-boulle @advance512 @donbowman @mihirverma7781 @rickeydbrown @potiuk . You all posted support in @mfmarche PR for upgrading V2 dependencies. This PR rolled back the Flask dependency from >=3 to >= 2.3.3. @Ruwann merged this PR and created a second pre-release candidate. Will you please test your code against the new pre-release and come back here to comment/vote for a final release. Just trying to find community support for promoting a pre-release to an actual release. Thanks!

@potiuk
Copy link

potiuk commented Jul 1, 2025

I am on it as we speak ! apache/airflow#51681 is my PR where I am (this is a bit of a back-burner) switching Airflow 2.11 to use it.

@noirbee
Copy link
Contributor

noirbee commented Jul 2, 2025

test your code against the new pre-release

@chrisinmtown We've been running 2.15.0rc2 in production since last week, without any noticeable change from connexion v2.14.0. Note however that we also upgraded to flask v3.1.1 at the same time, since this was a long-awaited update on our end.

As far as I'm concerned a v2.15.0 could be cut right now. The only clean up / minor fix left I'd maybe argue for is dropping the unused dependencies that were lifted from the v3 branch: a2wsgi, uvicorn and httpx for example are not in use at all by the v2 branch since they were added to v3 in order to switch to an async-first model.

EDIT: cf #2060 for said unused dependencies

@potiuk
Copy link

potiuk commented Jul 2, 2025

Yeah I am progressing a bit slower - we have a bit complex workflow with checking lowest dependencies and stuff, so give me a day or so to get everything green :).

Good idea with dropping dependencies. The less - the better.

@chrisinmtown
Copy link
Contributor Author

Please continue the testing conversation on the next PR to V2 :) which is #2060

@potiuk
Copy link

potiuk commented Jul 2, 2025

Please continue the testing conversation on the next PR to V2 :) which is #2060

Cool.

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.

5 participants