Skip to content

Upgrade to flask 2 - #1764

Merged
cyberw merged 1 commit into
locustio:masterfrom
corenting:flask2
Jul 5, 2021
Merged

cyberw merged 1 commit into
locustio:masterfrom
corenting:flask2

Conversation

@corenting

Copy link
Copy Markdown
Contributor

I noticed in issue #1759 that the flask version was pinned to the 1.x branch to fix compatibility issues. This PR introduces the necessary changes to bump Flask and werkzeug to version 2.x .

@cyberw

cyberw commented May 21, 2021

Copy link
Copy Markdown
Collaborator

Cool stuff! Right now there is just so much more flask 1.x running out there (that people might be running in the same env as locust or inside locust), so I dont think we want to merge this right now, but it is nice to know we can.

@corenting

Copy link
Copy Markdown
Contributor Author

Cool stuff! Right now there is just so much more flask 1.x running out there (that people might be running in the same env as locust or inside locust), so I dont think we want to merge this right now, but it is nice to know we can.

Thanks for the feedback :) Maybe I can add conditions to see which version of Flask is used and adapt the changes depending on this, to allow running with both Flask 1.x and Flask 2.x ?

@cyberw
cyberw marked this pull request as draft May 21, 2021 11:36
@cyberw

cyberw commented May 21, 2021

Copy link
Copy Markdown
Collaborator

Thanks for the feedback :) Maybe I can add conditions to see which version of Flask is used and adapt the changes depending on this, to allow running with both Flask 1.x and Flask 2.x ?

That would be nice. We'd still have to depend on 1.x in setup.py, but I guess it might still be useful for some people.

@cyberw

cyberw commented Jun 5, 2021

Copy link
Copy Markdown
Collaborator

Actually, I'm thinking about making a 2.0 release soon and it makes total sense to update flask at the same time. can you fix the formatting errors though?

@cyberw
cyberw marked this pull request as ready for review June 5, 2021 20:15
@corenting

corenting commented Jun 7, 2021 •

Copy link
Copy Markdown
Contributor Author

Actually, I'm thinking about making a 2.0 release soon and it makes total sense to update flask at the same time. can you fix the formatting errors though?

Sure ! I just pushed an update with formatting fixed. I didn't have time to verify the tests though, but look like they are OK on the CI.

@jjin-ut

jjin-ut commented Jun 21, 2021

Copy link
Copy Markdown

Thanks for the PR. I ran into this error just now when I try to run locust.

app.jinja_options["extensions"].append("jinja2.ext.do")
KeyError: 'extensions'

It was working for me a few hours ago, then all in sudden ran into this error. Nothing has changed on my side.
When is this PR going to be released? Hope it will fix the issue.

@cyberw

cyberw commented Jun 21, 2021

Copy link
Copy Markdown
Collaborator

Thanks for the PR. I ran into this error just now when I try to run locust.

app.jinja_options["extensions"].append("jinja2.ext.do")
KeyError: 'extensions'

It was working for me a few hours ago, then all in sudden ran into this error. Nothing has changed on my side.
When is this PR going to be released? Hope it will fix the issue.

I want to do this in 2.0, because it may be a breaking change for some people. Locust 1.5.3 uses a pinned 1.x version of Flask, so you shouldnt have this issue?

@jjin-ut

jjin-ut commented Jun 21, 2021

Copy link
Copy Markdown

Thanks for the PR. I ran into this error just now when I try to run locust.

app.jinja_options["extensions"].append("jinja2.ext.do")
KeyError: 'extensions'

It was working for me a few hours ago, then all in sudden ran into this error. Nothing has changed on my side.
When is this PR going to be released? Hope it will fix the issue.

I want to do this in 2.0, because it may be a breaking change for some people. Locust 1.5.3 uses a pinned 1.x version of Flask, so you shouldnt have this issue?

Ah my locust is 1.4.4. I'll update and see if it works. Thank you!

@jjin-ut

jjin-ut commented Jun 21, 2021

Copy link
Copy Markdown

Thanks for the PR. I ran into this error just now when I try to run locust.

app.jinja_options["extensions"].append("jinja2.ext.do")
KeyError: 'extensions'

It was working for me a few hours ago, then all in sudden ran into this error. Nothing has changed on my side.
When is this PR going to be released? Hope it will fix the issue.

I want to do this in 2.0, because it may be a breaking change for some people. Locust 1.5.3 uses a pinned 1.x version of Flask, so you shouldnt have this issue?

update to 1.5.3 fixed my problem. Thank you!

@cyberw
cyberw merged commit e01999e into locustio:master Jul 5, 2021
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