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

Bump flask from 2.1.3 to 2.2.2 #1656

Merged
merged 1 commit into from Aug 13, 2022
Merged

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Aug 12, 2022

Bumps flask from 2.1.3 to 2.2.2.

Release notes

Sourced from flask's releases.

2.2.2

This is a fix release for the 2.2.0 feature release.

2.2.1

This is a fix release for the 2.2.0 feature release.

2.2.0

This is a feature release, which includes new features and removes previously deprecated code. The 2.2.x branch is now the supported bug fix branch, the 2.1.x branch will become a tag marking the end of support for that branch. We encourage everyone to upgrade, and to use a tool such as pip-tools to pin all dependencies and control upgrades.

Changelog

Sourced from flask's changelog.

Version 2.2.2

Released 2022-08-08

  • Update Werkzeug dependency to >= 2.2.2. This includes fixes related to the new faster router, header parsing, and the development server. :pr:4754
  • Fix the default value for app.env to be "production". This attribute remains deprecated. :issue:4740

Version 2.2.1

Released 2022-08-03

  • Setting or accessing json_encoder or json_decoder raises a deprecation warning. :issue:4732

Version 2.2.0

Released 2022-08-01

  • Remove previously deprecated code. :pr:4667

    • Old names for some send_file parameters have been removed. download_name replaces attachment_filename, max_age replaces cache_timeout, and etag replaces add_etags. Additionally, path replaces filename in send_from_directory.
    • The RequestContext.g property returning AppContext.g is removed.
  • Update Werkzeug dependency to >= 2.2.

  • The app and request contexts are managed using Python context vars directly rather than Werkzeug's LocalStack. This should result in better performance and memory use. :pr:4682

    • Extension maintainers, be aware that _app_ctx_stack.top and _request_ctx_stack.top are deprecated. Store data on g instead using a unique prefix, like g._extension_name_attr.
  • The FLASK_ENV environment variable and app.env attribute are deprecated, removing the distinction between development and debug mode. Debug mode should be controlled directly using the --debug option or app.run(debug=True). :issue:4714

... (truncated)

Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [flask](https://github.com/pallets/flask) from 2.1.3 to 2.2.2.
- [Release notes](https://github.com/pallets/flask/releases)
- [Changelog](https://github.com/pallets/flask/blob/main/CHANGES.rst)
- [Commits](pallets/flask@2.1.3...2.2.2)

---
updated-dependencies:
- dependency-name: flask
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added dependencies python Pull requests that update Python code labels Aug 12, 2022
@return42
Copy link
Member

@dalf
Copy link
Member

dalf commented Aug 13, 2022

So LGTM.

@dalf dalf merged commit e81c458 into master Aug 13, 2022
@dalf dalf deleted the dependabot/pip/master/flask-2.2.2 branch August 13, 2022 16:33
@return42
Copy link
Member

return42 commented Aug 13, 2022

The #1616 (comment) was more about FLASK_ENV

You suggested #1616 (comment) .. would you like to open a issue or a PR from your suggestion? .. or is it no more needed?

@dalf
Copy link
Member

dalf commented Aug 13, 2022

True, this is about FLASK_ENV not FLASK_APP.

I've made some tests.

With Flask 2.1.3 and 2.2.2:

  • FLASK_APP=searx.webapp flask run --reload does the initialization twice on the first run, so the code is useless.
  • SEARXNG_DEBUG=1 FLASK_APP=searx.webapp flask run --reload does the initialization twice too.
  • SEARXNG_DEBUG=1 FLASK_APP=searx.webapp flask run does not reload the server when there is a code change.
  • SEARXNG_DEBUG=1 FLASK_APP=searx.webapp FLASK_ENV=development flask run works as expected : debug and reload.

With the last command line, there is a warning:
'FLASK_ENV' is deprecated and will not be used in Flask 2.3. Use 'FLASK_DEBUG' instead.

So to update the current (broken*) code:

searxng/searx/webapp.py

Lines 1381 to 1383 in e81c458

flask_run_development = (
os.environ.get("FLASK_APP") is not None and os.environ.get("FLASK_ENV") == 'development' and is_flask_run_cmdline()
)

should be replaced by:

os.environ.get("FLASK_APP") is not None and (os.environ.get("FLASK_ENV") == 'development' or os.environ.get("FLASK_DEBUG") not in {"0", "false", "no"} ) and is_flask_run_cmdline()

As long we don't that, the initialization steps are going to be done twice when users starts the app with SEARXNG_DEBUG=1 FLASK_APP=searx.webapp FLASK_DEBUG=1 flask run. It is an edge case AFIK.


broken because --reload does the initialization twice.

@return42
Copy link
Member

Thanks for detail description ..

It is an edge case AFIK.

Are the use cases of such "edge cases" needs to be supported? .. if not we can "clean up the code". AFAIK all we need to support is:

SEARXNG_DEBUG=1 pyenv.cmd python -m searx.webapp

What should restart the WEB-App on (python) code changes. Additional we can also rebuild JS & CSS on theme modifications:

LIVE_THEME=1 make run

So my question remain, should we (I) send a PR or open an issue to "clean up the code"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies python Pull requests that update Python code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants