Skip to content

754 deprecate flask env - #907

Merged
nhoening merged 24 commits into
mainfrom
754-depricate-flask-env
Jan 4, 2024
Merged

754 deprecate flask env#907
nhoening merged 24 commits into
mainfrom
754-depricate-flask-env

Conversation

@GustaafL

@GustaafL GustaafL commented Nov 23, 2023

Copy link
Copy Markdown
Contributor

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>
Comment thread flexmeasures/utils/config_utils.py Outdated
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>
@GustaafL
GustaafL requested review from Flix6x and nhoening November 29, 2023 08:26
@nhoening nhoening changed the title 754 depricate flask env 754 deprecate flask env Dec 6, 2023

@nhoening nhoening left a comment

Copy link
Copy Markdown
Member

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.

Comment thread requirements/app.in Outdated
Comment thread requirements/app.in Outdated
Comment thread flexmeasures/utils/config_utils.py
Comment thread flexmeasures/app.py Outdated
Comment thread flexmeasures/utils/config_utils.py Outdated
GustaafL added 2 commits December 11, 2023 14:55
Signed-off-by: GustaafL <guus@seita.nl>
Signed-off-by: GustaafL <guus@seita.nl>
@GustaafL
GustaafL requested a review from nhoening December 12, 2023 16:25

@nhoening nhoening left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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.

@GustaafL
GustaafL requested a review from nhoening December 18, 2023 15:39

@nhoening nhoening left a comment

Copy link
Copy Markdown
Member

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>
Comment thread requirements/app.in Outdated

@nhoening nhoening left a comment

Copy link
Copy Markdown
Member

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.

Comment thread flexmeasures/ui/utils/view_utils.py Outdated
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

@nhoening nhoening left a comment

Copy link
Copy Markdown
Member

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!

Comment thread documentation/changelog.rst Outdated
Comment thread flexmeasures/utils/config_utils.py Outdated
@GustaafL
GustaafL requested a review from nhoening January 3, 2024 08:23
@nhoening
nhoening merged commit 5eedda4 into main Jan 4, 2024
@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