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

Upgrade Flask ecosystem dependencies #838

Merged
merged 43 commits into from
Sep 22, 2023
Merged

Conversation

Flix6x
Copy link
Contributor

@Flix6x Flix6x commented Aug 30, 2023

Description

Unpin several dependencies within the Flask ecosystem:

  • Flask
  • Flask-Classful (the culprit blocker)
  • Flask-Login
  • Flask-Marshmallow
  • Flask-Security-Too
  • Flask-SQLAlchemy
  • Werkzeug

Also update rq-dashboard and modernize how we integrate this dashboard into our Flask app.

Look & Feel

image

How to test

make test

Further Improvements

  • Still need to find out how to show all registered queues in the Tasks dashboard. Update: this worked out of the box already. Apparently, I was initially using a redis server with just one queue set up.

Related Items

Closes #595.


  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on code under GPL or other license that is incompatible with FlexMeasures

…Classful

Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
@Flix6x Flix6x self-assigned this Aug 30, 2023
Copy link
Contributor

@nhoening nhoening left a comment

Choose a reason for hiding this comment

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

You have not upgraded dependencies after removing upper limits. I suspect that tests might not succeed then, e.g. with the problems in flask-login.

pip-installing would fail then.

requirements/app.in Outdated Show resolved Hide resolved
requirements/3.9/app.txt Outdated Show resolved Hide resolved
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
@nhoening
Copy link
Contributor

It seems we can also (since today) move to the real rq-dashboard's new version 0.6.6: Parallels/rq-dashboard#417 (comment)

This is the first release on Pypi in more than 3 years for them!

… Python 3.9

Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
@Flix6x
Copy link
Contributor Author

Flix6x commented Sep 3, 2023

I think what happened is that Flask-Login==0.6.2 started keeping test users logged in using a session cookie, which looked like it had precedence over the token in the Authorization header. I went through the API tests and started using a new fixture that logs in a user for the scope of the test (i.e. logging out before moving on to the next test).

I managed to upgrade to Flask==2.2.5. This is as far as I can take it before being blocked by #754.

The PR is still in draft awaiting a new release of Flask-Classful.

Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
@Flix6x Flix6x marked this pull request as ready for review September 8, 2023 09:04
@Flix6x Flix6x requested a review from nhoening September 8, 2023 09:04
@Flix6x Flix6x added this to the 0.16.0 milestone Sep 8, 2023
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: GustaafL <guus@seita.nl>
Copy link
Contributor

@nhoening nhoening left a comment

Choose a reason for hiding this comment

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

Great that you could resolve bottlenecks here!

I have a few smaller issues, and of course we miss the 3.8 pins. I'll talk to @Nischay-Pro , maybe his current work can be used here (dev script to update dependencies per Python version)

flexmeasures/api/conftest.py Outdated Show resolved Hide resolved
flexmeasures/api/v3_0/tests/test_sensors_api.py Outdated Show resolved Hide resolved
flexmeasures/api/v3_0/tests/test_api_v3_0_users.py Outdated Show resolved Hide resolved
flexmeasures/api/conftest.py Show resolved Hide resolved
flexmeasures/api/v3_0/tests/test_assets_api.py Outdated Show resolved Hide resolved
flexmeasures/ui/templates/base.html Outdated Show resolved Hide resolved
flexmeasures/ui/templates/base.html Outdated Show resolved Hide resolved
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
…ng in

Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Flix6x and others added 9 commits September 12, 2023 09:53
…orted Python versions

Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
… patch in flask-security for now (this works without patch outside of testing).

Signed-off-by: Nicolas Höning <nicolas@seita.nl>
…finition (was: schema), just like others. Became possible with recent enhancements of permission_required_for_context capabilities

Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
@Flix6x Flix6x merged commit db9282f into main Sep 22, 2023
9 checks passed
@Flix6x Flix6x deleted the upgrade-flask-ecosystem-dependencies branch September 22, 2023 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade or replace Flask-Classful
3 participants