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

754 deprecate flask env #907

Merged
merged 24 commits into from Jan 4, 2024
Merged

754 deprecate flask env #907

merged 24 commits into from Jan 4, 2024

Conversation

GustaafL
Copy link
Contributor

@GustaafL GustaafL commented Nov 23, 2023

Description

This PR removes the need for FLASK_ENV, which is deprecated from Flask 2.3 on. Instead of FLASK_ENV use FLEXMEASURES_ENV with the same options.

Look & Feel

In the environment variables set "FLEXMEASURES_ENV"="development" instead of "FLASK_ENV"="development"

Further Improvements

Potential improvements to be done in the same PR or follow up Issues/Discussions/PRs.

Related Items

This closes #754


  • 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

GustaafL added 3 commits November 23, 2023 16:03
…_env

Signed-off-by: GustaafL <guus@seita.nl>
Signed-off-by: GustaafL <guus@seita.nl>
Signed-off-by: GustaafL <guus@seita.nl>
@GustaafL GustaafL linked an issue Nov 24, 2023 that may be closed by this pull request
Signed-off-by: GustaafL <guus@seita.nl>
GustaafL and others added 4 commits November 24, 2023 10:16
Signed-off-by: GustaafL <41048720+GustaafL@users.noreply.github.com>
Signed-off-by: GustaafL <41048720+GustaafL@users.noreply.github.com>
… variables

Signed-off-by: GustaafL <guus@seita.nl>
…sures/flexmeasures into 754-depricate-flask-env
Signed-off-by: GustaafL <guus@seita.nl>
@GustaafL GustaafL marked this pull request as ready for review November 27, 2023 15:12
Signed-off-by: GustaafL <guus@seita.nl>
@nhoening nhoening changed the title 754 depricate flask env 754 deprecate flask env Dec 6, 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.

This approach seems to be reasonable.
We are not finished, though :)

  • The docstring of create() in app.py still mentions FLASK_ENV.
  • A few mentions of Flask_ENV are in the documentation (run grep -r FLASK_ENV documentation), as well as in docker-compose.yml and should be updated.

requirements/app.in Outdated Show resolved Hide resolved
requirements/app.in Outdated Show resolved Hide resolved
flexmeasures/utils/config_utils.py Show resolved Hide resolved
flexmeasures/app.py Outdated Show resolved Hide resolved
flexmeasures/utils/config_utils.py Outdated Show resolved Hide resolved
GustaafL added 2 commits December 11, 2023 14:55
Signed-off-by: GustaafL <guus@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.

My comment from the last review (about several places where Flask_ENV is still mentioned or used) has not been addressed.

GustaafL added 2 commits December 18, 2023 10:01
Signed-off-by: GustaafL <guus@seita.nl>
@GustaafL
Copy link
Contributor Author

I've reviewed all the mentions of FLASK_ENV that were in the docs as well and changed them to FLEXMEASURES_ENV where it was relevant.

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.

As I wrote earlier, there is also Flask_ENVin docker-compose.yml.
I simply ran grep -r "FLASK_ENV" . to find places.

Also, there is a merge conflict, please resolve it.

GustaafL and others added 2 commits December 19, 2023 09:28
Signed-off-by: GustaafL <guus@seita.nl>
Signed-off-by: GustaafL <41048720+GustaafL@users.noreply.github.com>
requirements/app.in Outdated Show resolved Hide resolved
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.

I found one more issue worth our attention.

flexmeasures/ui/utils/view_utils.py Outdated Show resolved Hide resolved
GustaafL added 4 commits December 19, 2023 10:34
Signed-off-by: GustaafL <guus@seita.nl>
Signed-off-by: GustaafL <guus@seita.nl>
Signed-off-by: GustaafL <guus@seita.nl>
Signed-off-by: GustaafL <guus@seita.nl>
@nhoening nhoening modified the milestones: 0.18.0, 0.19.0 Dec 19, 2023
Signed-off-by: GustaafL <41048720+GustaafL@users.noreply.github.com>
@GustaafL GustaafL requested a review from nhoening January 2, 2024 09:29
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.

Just two small chores left!

documentation/changelog.rst Outdated Show resolved Hide resolved
flexmeasures/utils/config_utils.py Outdated Show resolved Hide resolved
@GustaafL GustaafL requested a review from nhoening January 3, 2024 08:23
@nhoening nhoening merged commit 5eedda4 into main Jan 4, 2024
7 of 9 checks passed
@nhoening nhoening deleted the 754-depricate-flask-env branch January 4, 2024 08:40
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.

Retire FLASK_ENV (becomes FLEXMEASURES_ENV)
4 participants