Skip to content
Myr

Merge branch '3.0.x'

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Lord · committed by David Lord · parents 8a6cdf1, 2c5d652 · Browse files · 16 files+112 added−104 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

16 files+112 added−104 removed

  • other:+112 added−104 removed

16 files+112 added−104 removed

modified:.github/workflows/publish.yaml+1 added-1 removed
deleted:.github/dependabot.yml-18 removed
modified:docs/deploying/waitress.rst+1 added-1 removed
66 unmodified lines
67reverse proxy such as :doc:`nginx` or :doc:`apache-httpd` should be used68in front of Waitress.6970You can bind to all external IPs on a non-privileged port by not71specifying the ``--host`` option. Don't do this when using a revers71specifying the ``--host`` option. Don't do this when using a reverse72proxy setup, otherwise it will be possible to bypass the proxy.7374``0.0.0.0`` is not a valid address to navigate to, you'd use a specific75IP address in your browser.
modified:docs/config.rst+6 added
140 unmodified lines
141 Not setting this value is more restricted and secure than setting it.142143 Default: ``None``144145 .. warning::146 If this is changed after the browser created a cookie is created with147 one setting, it may result in another being created. Browsers may send148 send both in an undefined order. In that case, you may want to change149 :data:`SESSION_COOKIE_NAME` as well or otherwise invalidate old sessions.150151 .. versionchanged:: 2.3152 Not set by default, does not fall back to ``SERVER_NAME``.153154.. py:data:: SESSION_COOKIE_PATH
583 unmodified lines
modified:docs/quickstart.rst+4 added-4 removed
373 unmodified lines
374375 @app.route('/hello/')376 @app.route('/hello/<name>')377 def hello(name=None):378 return render_template('hello.html', name=name)378 return render_template('hello.html', person=name)379380Flask will look for templates in the :file:`templates` folder. So if your381application is a module, this folder is next to that module, if it's a382package it's actually inside your package:
20 unmodified lines
403.. sourcecode:: html+jinja404405 <!doctype html>406 <title>Hello from Flask</title>407 {% if name %}408 <h1>Hello {{ name }}!</h1>407 {% if person %}408 <h1>Hello {{ person }}!</h1>409 {% else %}410 <h1>Hello, World!</h1>411 {% endif %}412
5 unmodified lines
418know how that works, see :doc:`patterns/templateinheritance`. Basically419template inheritance makes it possible to keep certain elements on each420page (like header, navigation and footer).421422Automatic escaping is enabled, so if ``name`` contains HTML it will be escaped422Automatic escaping is enabled, so if ``person`` contains HTML it will be escaped423automatically. If you can trust a variable and you know that it will be424safe HTML (for example because it came from a module that converts wiki425markup to HTML) you can mark it as safe by using the426:class:`~markupsafe.Markup` class or by using the ``|safe`` filter in the
481 unmodified lines
modified:requirements/build.txt+2 added-2 removed
4 unmodified lines
5# pip-compile build.in6#7build==1.2.18 # via -r build.in9packaging==24.09packaging==24.110 # via build11pyproject-hooks==1.0.011pyproject-hooks==1.1.012 # via build
modified:requirements/dev.txt+32 added-35 removed
2 unmodified lines
3# by the following command:4#5# pip-compile dev.in6#7alabaster==0.7.167alabaster==1.0.08 # via9 # -r docs.txt10 # sphinx11asgiref==3.8.112 # via13 # -r tests.txt14 # -r typing.txt15babel==2.14.015babel==2.16.016 # via17 # -r docs.txt18 # sphinx19cachetools==5.3.319cachetools==5.5.020 # via tox21certifi==2024.2.221certifi==2024.7.422 # via23 # -r docs.txt24 # requests25cffi==1.16.025cffi==1.17.026 # via27 # -r typing.txt28 # cryptography29cfgv==3.4.0
5 unmodified lines
35 # -r docs.txt36 # requests37colorama==0.4.638 # via tox39cryptography==42.0.839cryptography==43.0.040 # via -r typing.txt41distlib==0.3.842 # via virtualenv43docutils==0.20.143docutils==0.21.244 # via45 # -r docs.txt46 # sphinx47 # sphinx-tabs48filelock==3.13.348filelock==3.15.449 # via50 # tox51 # virtualenv52identify==2.5.3552identify==2.6.053 # via pre-commit54idna==3.654idna==3.855 # via56 # -r docs.txt57 # requests58imagesize==1.4.1
4 unmodified lines
63 # via64 # -r tests.txt65 # -r typing.txt66 # pytest67jinja2==3.1.367jinja2==3.1.468 # via69 # -r docs.txt70 # sphinx71markupsafe==2.1.572 # via73 # -r docs.txt74 # jinja275mypy==1.10.175mypy==1.11.176 # via -r typing.txt77mypy-extensions==1.0.078 # via79 # -r typing.txt80 # mypy81nodeenv==1.8.081nodeenv==1.9.182 # via83 # -r typing.txt84 # pre-commit85 # pyright86packaging==24.086packaging==24.187 # via88 # -r docs.txt89 # -r tests.txt90 # -r typing.txt
3 unmodified lines
94 # sphinx95 # tox96pallets-sphinx-themes==2.1.397 # via -r docs.txt98platformdirs==4.2.098platformdirs==4.2.299 # via100 # tox101 # virtualenv102pluggy==1.5.0
1 unmodified line
104 # -r tests.txt105 # -r typing.txt106 # pytest107 # tox108pre-commit==3.7.1108pre-commit==3.8.0109 # via -r dev.in110pycparser==2.22111 # via112 # -r typing.txt113 # cffi114pygments==2.17.2114pygments==2.18.0115 # via116 # -r docs.txt117 # sphinx118 # sphinx-tabs119pyproject-api==1.6.1119pyproject-api==1.7.1120 # via tox121pyright==1.1.369121pyright==1.1.377122 # via -r typing.txt123pytest==8.2.2123pytest==8.3.2124 # via125 # -r tests.txt126 # -r typing.txt127python-dotenv==1.0.1128 # via129 # -r tests.txt130 # -r typing.txt131pyyaml==6.0.1131pyyaml==6.0.2132 # via pre-commit133requests==2.31.0133requests==2.32.3134 # via135 # -r docs.txt136 # sphinx137snowballstemmer==2.2.0138 # via139 # -r docs.txt140 # sphinx141sphinx==7.3.7141sphinx==8.0.2142 # via143 # -r docs.txt144 # pallets-sphinx-themes145 # sphinx-tabs146 # sphinxcontrib-log-cabinet147sphinx-tabs==3.4.5148 # via -r docs.txt149sphinxcontrib-applehelp==1.0.8149sphinxcontrib-applehelp==2.0.0150 # via151 # -r docs.txt152 # sphinx153sphinxcontrib-devhelp==1.0.6153sphinxcontrib-devhelp==2.0.0154 # via155 # -r docs.txt156 # sphinx157sphinxcontrib-htmlhelp==2.0.5157sphinxcontrib-htmlhelp==2.1.0158 # via159 # -r docs.txt160 # sphinx161sphinxcontrib-jsmath==1.0.1
1 unmodified line
163 # -r docs.txt164 # sphinx165sphinxcontrib-log-cabinet==1.0.1166 # via -r docs.txt167sphinxcontrib-qthelp==1.0.7167sphinxcontrib-qthelp==2.0.0168 # via169 # -r docs.txt170 # sphinx171sphinxcontrib-serializinghtml==1.1.10171sphinxcontrib-serializinghtml==2.0.0172 # via173 # -r docs.txt174 # sphinx175tox==4.15.1175tox==4.18.0176 # via -r dev.in177types-contextvars==2.4.7.3178 # via -r typing.txt179types-dataclasses==0.6.6180 # via -r typing.txt181typing-extensions==4.11.0181typing-extensions==4.12.2182 # via183 # -r typing.txt184 # mypy185urllib3==2.2.1185urllib3==2.2.2186 # via187 # -r docs.txt188 # requests189virtualenv==20.25.1189virtualenv==20.26.3190 # via191 # pre-commit192 # tox193194# The following packages are considered to be unsafe in a requirements file:195# setuptools
modified:requirements/docs.txt+16 added-16 removed
2 unmodified lines
3# by the following command:4#5# pip-compile docs.in6#7alabaster==0.7.167alabaster==1.0.08 # via sphinx9babel==2.14.09babel==2.16.010 # via sphinx11certifi==2024.2.211certifi==2024.7.412 # via requests13charset-normalizer==3.3.214 # via requests15docutils==0.20.115docutils==0.21.216 # via17 # sphinx18 # sphinx-tabs19idna==3.619idna==3.820 # via requests21imagesize==1.4.122 # via sphinx23jinja2==3.1.323jinja2==3.1.424 # via sphinx25markupsafe==2.1.526 # via jinja227packaging==24.027packaging==24.128 # via29 # pallets-sphinx-themes30 # sphinx31pallets-sphinx-themes==2.1.332 # via -r docs.in33pygments==2.17.233pygments==2.18.034 # via35 # sphinx36 # sphinx-tabs37requests==2.31.037requests==2.32.338 # via sphinx39snowballstemmer==2.2.040 # via sphinx41sphinx==7.3.741sphinx==8.0.242 # via43 # -r docs.in44 # pallets-sphinx-themes45 # sphinx-tabs46 # sphinxcontrib-log-cabinet47sphinx-tabs==3.4.548 # via -r docs.in49sphinxcontrib-applehelp==1.0.849sphinxcontrib-applehelp==2.0.050 # via sphinx51sphinxcontrib-devhelp==1.0.651sphinxcontrib-devhelp==2.0.052 # via sphinx53sphinxcontrib-htmlhelp==2.0.553sphinxcontrib-htmlhelp==2.1.054 # via sphinx55sphinxcontrib-jsmath==1.0.156 # via sphinx57sphinxcontrib-log-cabinet==1.0.158 # via -r docs.in59sphinxcontrib-qthelp==1.0.759sphinxcontrib-qthelp==2.0.060 # via sphinx61sphinxcontrib-serializinghtml==1.1.1061sphinxcontrib-serializinghtml==2.0.062 # via sphinx63urllib3==2.2.163urllib3==2.2.264 # via requests
modified:requirements/tests.txt+2 added-2 removed
6 unmodified lines
7asgiref==3.8.18 # via -r tests.in9iniconfig==2.0.010 # via pytest11packaging==24.011packaging==24.112 # via pytest13pluggy==1.5.014 # via pytest15pytest==8.2.215pytest==8.3.216 # via -r tests.in17python-dotenv==1.0.118 # via -r tests.in
modified:requirements/typing.txt+8 added-11 removed
4 unmodified lines
5# pip-compile typing.in6#7asgiref==3.8.18 # via -r typing.in9cffi==1.16.09cffi==1.17.010 # via cryptography11cryptography==42.0.811cryptography==43.0.012 # via -r typing.in13iniconfig==2.0.014 # via pytest15mypy==1.10.115mypy==1.11.116 # via -r typing.in17mypy-extensions==1.0.018 # via mypy19nodeenv==1.8.019nodeenv==1.9.120 # via pyright21packaging==24.021packaging==24.122 # via pytest23pluggy==1.5.024 # via pytest25pycparser==2.2226 # via cffi27pyright==1.1.36927pyright==1.1.37728 # via -r typing.in29pytest==8.2.229pytest==8.3.230 # via -r typing.in31python-dotenv==1.0.132 # via -r typing.in33types-contextvars==2.4.7.334 # via -r typing.in35types-dataclasses==0.6.636 # via -r typing.in37typing-extensions==4.11.037typing-extensions==4.12.238 # via mypy3940# The following packages are considered to be unsafe in a requirements file:41# setuptools
modified:src/flask/json/provider.py+1 added-1 removed
111 unmodified lines
112 if isinstance(o, (decimal.Decimal, uuid.UUID)):113 return str(o)114115 if dataclasses and dataclasses.is_dataclass(o):116 return dataclasses.asdict(o)116 return dataclasses.asdict(o) # type: ignore[call-overload]117118 if hasattr(o, "__html__"):119 return str(o.__html__())120
95 unmodified lines
modified:src/flask/sansio/app.py+1 added-1 removed
289 unmodified lines
290 template_folder: str | os.PathLike[str] | None = "templates",291 instance_path: str | None = None,292 instance_relative_config: bool = False,293 root_path: str | None = None,294 ):294 ) -> None:295 super().__init__(296 import_name=import_name,297 static_folder=static_folder,298 static_url_path=static_url_path,
666 unmodified lines
modified:src/flask/helpers.py+13 added-1 removed
45 unmodified lines
4647 return val.lower() in ("0", "false", "no")484950@t.overload51def stream_with_context(52 generator_or_function: t.Iterator[t.AnyStr],53) -> t.Iterator[t.AnyStr]: ...545556@t.overload57def stream_with_context(58 generator_or_function: t.Callable[..., t.Iterator[t.AnyStr]],59) -> t.Callable[[t.Iterator[t.AnyStr]], t.Iterator[t.AnyStr]]: ...606162def stream_with_context(63 generator_or_function: t.Iterator[t.AnyStr] | t.Callable[..., t.Iterator[t.AnyStr]],52) -> t.Iterator[t.AnyStr]:64) -> t.Iterator[t.AnyStr] | t.Callable[[t.Iterator[t.AnyStr]], t.Iterator[t.AnyStr]]:65 """Request contexts disappear when the response is started on the server.66 This is done for efficiency reasons and to make it less likely to encounter67 memory leaks with badly written WSGI middlewares. The downside is that if68 you are using streamed responses, the generator cannot access request bound
565 unmodified lines
modified:.pre-commit-config.yaml+1 added-1 removed
1ci:2 autoupdate_schedule: monthly3repos:4 - repo: https://github.com/astral-sh/ruff-pre-commit5 rev: v0.5.65 rev: v0.6.26 hooks:7 - id: ruff8 - id: ruff-format9 - repo: https://github.com/pre-commit/pre-commit-hooks
7 unmodified lines
modified:pyproject.toml+5 added-1 removed
111 unmodified lines
112 "I", # isort113 "UP", # pyupgrade114 "W", # pycodestyle warning115]116ignore-init-module-imports = true116117[tool.ruff.lint.isort]118force-single-line = true119order-by-type = false120121[tool.gha-update]122tag-only = [123 "slsa-framework/slsa-github-generator",124]
modified:tox.ini+19 added-9 removed
32 unmodified lines
33[testenv:docs]34deps = -r requirements/docs.txt35commands = sphinx-build -E -W -b dirhtml docs docs/_build/dirhtml3637[testenv:update-actions]38labels = update39deps = gha-update40commands = gha-update4142[testenv:update-pre_commit]43labels = update44deps = pre-commit45skip_install = true46commands = pre-commit autoupdate -j44748[testenv:update-requirements]38deps =39 pip-tools40 pre-commit49base_python = 3.1250labels = update51deps = pip-tools52skip_install = true53change_dir = requirements54commands =44 pre-commit autoupdate -j445 pip-compile -U build.in46 pip-compile -U docs.in47 pip-compile -U tests.in48 pip-compile -U typing.in49 pip-compile -U dev.in55 pip-compile build.in -q {posargs:-U}56 pip-compile docs.in -q {posargs:-U}57 pip-compile tests.in -q {posargs:-U}58 pip-compile typing.in -q {posargs:-U}59 pip-compile dev.in -q {posargs:-U}