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
Provenance
- Commit
4e6384d- Tree
bbf572e- Author
David Lord <davidism@gmail.com>- Committer
David Lord <davidism@gmail.com>- Parent 1
8a6cdf1- Parent 2
2c5d652
16 files changed+112 added−104 removed
modified:.github/workflows/publish.yaml+1 added-1 removed
21 unmodified lines2223242526262728293043 unmodified lines21 unmodified lines # Generate hashes used for provenance. - name: generate hash id: hash run: cd dist && echo "hash=$(sha256sum * | base64 -w0)" >> $GITHUB_OUTPUT - uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 - uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6 with: path: ./dist provenance: needs: [build]43 unmodified linesdeleted:.github/dependabot.yml-18 removed
123456789101112131415161718version: 2updates: - package-ecosystem: github-actions directory: / schedule: interval: monthly groups: github-actions: patterns: - '*' - package-ecosystem: pip directory: /requirements/ schedule: interval: monthly groups: python-requirements: patterns: - '*'modified:docs/deploying/waitress.rst+1 added-1 removed
66 unmodified lines67 reverse proxy such as :doc:`nginx` or :doc:`apache-httpd` should be used68 in front of Waitress.69 70 You can bind to all external IPs on a non-privileged port by not71-specifying the ``--host`` option. Don't do this when using a revers71+specifying the ``--host`` option. Don't do this when using a reverse72 proxy setup, otherwise it will be possible to bypass the proxy.73 74 ``0.0.0.0`` is not a valid address to navigate to, you'd use a specific75 IP address in your browser.modified:docs/config.rst+6 added
140 unmodified lines141 Not setting this value is more restricted and secure than setting it.142 143 Default: ``None``144 145+ .. 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.150+151 .. versionchanged:: 2.3152 Not set by default, does not fall back to ``SERVER_NAME``.153 154 .. py:data:: SESSION_COOKIE_PATH583 unmodified linesmodified:docs/quickstart.rst+4 added-4 removed
373 unmodified lines374 375 @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)379 380 Flask will look for templates in the :file:`templates` folder. So if your381 application is a module, this folder is next to that module, if it's a382 package it's actually inside your package:20 unmodified lines403 .. sourcecode:: html+jinja404 405 <!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 lines418 know how that works, see :doc:`patterns/templateinheritance`. Basically419 template inheritance makes it possible to keep certain elements on each420 page (like header, navigation and footer).421 422-Automatic escaping is enabled, so if ``name`` contains HTML it will be escaped422+Automatic escaping is enabled, so if ``person`` contains HTML it will be escaped423 automatically. If you can trust a variable and you know that it will be424 safe HTML (for example because it came from a module that converts wiki425 markup to HTML) you can mark it as safe by using the426 :class:`~markupsafe.Markup` class or by using the ``|safe`` filter in the481 unmodified linesmodified:requirements/build.txt+2 added-2 removed
4 unmodified lines5 # pip-compile build.in6 #7 build==1.2.18 # via -r build.in9-packaging==24.09+packaging==24.110 # via build11-pyproject-hooks==1.0.011+pyproject-hooks==1.1.012 # via buildmodified:requirements/dev.txt+32 added-35 removed
2 unmodified lines3 # by the following command:4 #5 # pip-compile dev.in6 #7-alabaster==0.7.167+alabaster==1.0.08 # via9 # -r docs.txt10 # sphinx11 asgiref==3.8.112 # via13 # -r tests.txt14 # -r typing.txt15-babel==2.14.015+babel==2.16.016 # via17 # -r docs.txt18 # sphinx19-cachetools==5.3.319+cachetools==5.5.020 # via tox21-certifi==2024.2.221+certifi==2024.7.422 # via23 # -r docs.txt24 # requests25-cffi==1.16.025+cffi==1.17.026 # via27 # -r typing.txt28 # cryptography29 cfgv==3.4.05 unmodified lines35 # -r docs.txt36 # requests37 colorama==0.4.638 # via tox39-cryptography==42.0.839+cryptography==43.0.040 # via -r typing.txt41 distlib==0.3.842 # via virtualenv43-docutils==0.20.143+docutils==0.21.244 # via45 # -r docs.txt46 # sphinx47 # sphinx-tabs48-filelock==3.13.348+filelock==3.15.449 # via50 # tox51 # virtualenv52-identify==2.5.3552+identify==2.6.053 # via pre-commit54-idna==3.654+idna==3.855 # via56 # -r docs.txt57 # requests58 imagesize==1.4.14 unmodified lines63 # via64 # -r tests.txt65 # -r typing.txt66 # pytest67-jinja2==3.1.367+jinja2==3.1.468 # via69 # -r docs.txt70 # sphinx71 markupsafe==2.1.572 # via73 # -r docs.txt74 # jinja275-mypy==1.10.175+mypy==1.11.176 # via -r typing.txt77 mypy-extensions==1.0.078 # via79 # -r typing.txt80 # mypy81-nodeenv==1.8.081+nodeenv==1.9.182 # via83 # -r typing.txt84 # pre-commit85 # pyright86-packaging==24.086+packaging==24.187 # via88 # -r docs.txt89 # -r tests.txt90 # -r typing.txt3 unmodified lines94 # sphinx95 # tox96 pallets-sphinx-themes==2.1.397 # via -r docs.txt98-platformdirs==4.2.098+platformdirs==4.2.299 # via100 # tox101 # virtualenv102 pluggy==1.5.01 unmodified line104 # -r tests.txt105 # -r typing.txt106 # pytest107 # tox108-pre-commit==3.7.1108+pre-commit==3.8.0109 # via -r dev.in110 pycparser==2.22111 # via112 # -r typing.txt113 # cffi114-pygments==2.17.2114+pygments==2.18.0115 # via116 # -r docs.txt117 # sphinx118 # sphinx-tabs119-pyproject-api==1.6.1119+pyproject-api==1.7.1120 # via tox121-pyright==1.1.369121+pyright==1.1.377122 # via -r typing.txt123-pytest==8.2.2123+pytest==8.3.2124 # via125 # -r tests.txt126 # -r typing.txt127 python-dotenv==1.0.1128 # via129 # -r tests.txt130 # -r typing.txt131-pyyaml==6.0.1131+pyyaml==6.0.2132 # via pre-commit133-requests==2.31.0133+requests==2.32.3134 # via135 # -r docs.txt136 # sphinx137 snowballstemmer==2.2.0138 # via139 # -r docs.txt140 # sphinx141-sphinx==7.3.7141+sphinx==8.0.2142 # via143 # -r docs.txt144 # pallets-sphinx-themes145 # sphinx-tabs146 # sphinxcontrib-log-cabinet147 sphinx-tabs==3.4.5148 # via -r docs.txt149-sphinxcontrib-applehelp==1.0.8149+sphinxcontrib-applehelp==2.0.0150 # via151 # -r docs.txt152 # sphinx153-sphinxcontrib-devhelp==1.0.6153+sphinxcontrib-devhelp==2.0.0154 # via155 # -r docs.txt156 # sphinx157-sphinxcontrib-htmlhelp==2.0.5157+sphinxcontrib-htmlhelp==2.1.0158 # via159 # -r docs.txt160 # sphinx161 sphinxcontrib-jsmath==1.0.11 unmodified line163 # -r docs.txt164 # sphinx165 sphinxcontrib-log-cabinet==1.0.1166 # via -r docs.txt167-sphinxcontrib-qthelp==1.0.7167+sphinxcontrib-qthelp==2.0.0168 # via169 # -r docs.txt170 # sphinx171-sphinxcontrib-serializinghtml==1.1.10171+sphinxcontrib-serializinghtml==2.0.0172 # via173 # -r docs.txt174 # sphinx175-tox==4.15.1175+tox==4.18.0176 # via -r dev.in177 types-contextvars==2.4.7.3178 # via -r typing.txt179 types-dataclasses==0.6.6180 # via -r typing.txt181-typing-extensions==4.11.0181+typing-extensions==4.12.2182 # via183 # -r typing.txt184 # mypy185-urllib3==2.2.1185+urllib3==2.2.2186 # via187 # -r docs.txt188 # requests189-virtualenv==20.25.1189+virtualenv==20.26.3190 # via191 # pre-commit192 # tox193-194-# The following packages are considered to be unsafe in a requirements file:195-# setuptoolsmodified:requirements/docs.txt+16 added-16 removed
2 unmodified lines3 # by the following command:4 #5 # pip-compile docs.in6 #7-alabaster==0.7.167+alabaster==1.0.08 # via sphinx9-babel==2.14.09+babel==2.16.010 # via sphinx11-certifi==2024.2.211+certifi==2024.7.412 # via requests13 charset-normalizer==3.3.214 # via requests15-docutils==0.20.115+docutils==0.21.216 # via17 # sphinx18 # sphinx-tabs19-idna==3.619+idna==3.820 # via requests21 imagesize==1.4.122 # via sphinx23-jinja2==3.1.323+jinja2==3.1.424 # via sphinx25 markupsafe==2.1.526 # via jinja227-packaging==24.027+packaging==24.128 # via29 # pallets-sphinx-themes30 # sphinx31 pallets-sphinx-themes==2.1.332 # via -r docs.in33-pygments==2.17.233+pygments==2.18.034 # via35 # sphinx36 # sphinx-tabs37-requests==2.31.037+requests==2.32.338 # via sphinx39 snowballstemmer==2.2.040 # via sphinx41-sphinx==7.3.741+sphinx==8.0.242 # via43 # -r docs.in44 # pallets-sphinx-themes45 # sphinx-tabs46 # sphinxcontrib-log-cabinet47 sphinx-tabs==3.4.548 # via -r docs.in49-sphinxcontrib-applehelp==1.0.849+sphinxcontrib-applehelp==2.0.050 # via sphinx51-sphinxcontrib-devhelp==1.0.651+sphinxcontrib-devhelp==2.0.052 # via sphinx53-sphinxcontrib-htmlhelp==2.0.553+sphinxcontrib-htmlhelp==2.1.054 # via sphinx55 sphinxcontrib-jsmath==1.0.156 # via sphinx57 sphinxcontrib-log-cabinet==1.0.158 # via -r docs.in59-sphinxcontrib-qthelp==1.0.759+sphinxcontrib-qthelp==2.0.060 # via sphinx61-sphinxcontrib-serializinghtml==1.1.1061+sphinxcontrib-serializinghtml==2.0.062 # via sphinx63-urllib3==2.2.163+urllib3==2.2.264 # via requestsmodified:requirements/tests.txt+2 added-2 removed
6 unmodified lines7 asgiref==3.8.18 # via -r tests.in9 iniconfig==2.0.010 # via pytest11-packaging==24.011+packaging==24.112 # via pytest13 pluggy==1.5.014 # via pytest15-pytest==8.2.215+pytest==8.3.216 # via -r tests.in17 python-dotenv==1.0.118 # via -r tests.inmodified:requirements/typing.txt+8 added-11 removed
4 unmodified lines5 # pip-compile typing.in6 #7 asgiref==3.8.18 # via -r typing.in9-cffi==1.16.09+cffi==1.17.010 # via cryptography11-cryptography==42.0.811+cryptography==43.0.012 # via -r typing.in13 iniconfig==2.0.014 # via pytest15-mypy==1.10.115+mypy==1.11.116 # via -r typing.in17 mypy-extensions==1.0.018 # via mypy19-nodeenv==1.8.019+nodeenv==1.9.120 # via pyright21-packaging==24.021+packaging==24.122 # via pytest23 pluggy==1.5.024 # via pytest25 pycparser==2.2226 # via cffi27-pyright==1.1.36927+pyright==1.1.37728 # via -r typing.in29-pytest==8.2.229+pytest==8.3.230 # via -r typing.in31 python-dotenv==1.0.132 # via -r typing.in33 types-contextvars==2.4.7.334 # via -r typing.in35 types-dataclasses==0.6.636 # via -r typing.in37-typing-extensions==4.11.037+typing-extensions==4.12.238 # via mypy39-40-# The following packages are considered to be unsafe in a requirements file:41-# setuptoolsmodified:src/flask/json/provider.py+1 added-1 removed
111 unmodified lines112 if isinstance(o, (decimal.Decimal, uuid.UUID)):113 return str(o)114 115 if dataclasses and dataclasses.is_dataclass(o):116- return dataclasses.asdict(o)116+ return dataclasses.asdict(o) # type: ignore[call-overload]117 118 if hasattr(o, "__html__"):119 return str(o.__html__())120 95 unmodified linesmodified:src/flask/sansio/app.py+1 added-1 removed
289 unmodified lines290 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 linesmodified:src/flask/helpers.py+13 added-1 removed
45 unmodified lines46 47 return val.lower() in ("0", "false", "no")48 49 50+@t.overload51 def stream_with_context(52+ generator_or_function: t.Iterator[t.AnyStr],53+) -> t.Iterator[t.AnyStr]: ...54+55+56+@t.overload57+def stream_with_context(58+ generator_or_function: t.Callable[..., t.Iterator[t.AnyStr]],59+) -> t.Callable[[t.Iterator[t.AnyStr]], t.Iterator[t.AnyStr]]: ...60+61+62+def 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 bound565 unmodified linesmodified:.pre-commit-config.yaml+1 added-1 removed
1 ci:2 autoupdate_schedule: monthly3 repos: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-hooks7 unmodified linesmodified:pyproject.toml+5 added-1 removed
111 unmodified lines112 "I", # isort113 "UP", # pyupgrade114 "W", # pycodestyle warning115 ]116-ignore-init-module-imports = true116 117 [tool.ruff.lint.isort]118 force-single-line = true119 order-by-type = false120+121+[tool.gha-update]122+tag-only = [123+ "slsa-framework/slsa-github-generator",124+]modified:tox.ini+19 added-9 removed
32 unmodified lines33 [testenv:docs]34 deps = -r requirements/docs.txt35 commands = sphinx-build -E -W -b dirhtml docs docs/_build/dirhtml36 37+[testenv:update-actions]38+labels = update39+deps = gha-update40+commands = gha-update41+42+[testenv:update-pre_commit]43+labels = update44+deps = pre-commit45+skip_install = true46+commands = pre-commit autoupdate -j447+48 [testenv:update-requirements]38-deps =39- pip-tools40- pre-commit49+base_python = 3.1250+labels = update51+deps = pip-tools52 skip_install = true53 change_dir = requirements54 commands =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}