Merge branch '2.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 bc094db, d6496c8 · Browse files · 23 files·+221 added−180 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
23 files+221 added−180 removed
- tests:+16 added−4 removed
- other:+205 added−176 removed
Provenance
- Commit
e37e871- Tree
35ea857- Author
David Lord <davidism@gmail.com>- Committer
David Lord <davidism@gmail.com>- Parent 1
bc094db- Parent 2
d6496c8
23 files changed+221 added−180 removed
modified:.github/workflows/tests.yaml+2 added-8 removed
38 unmodified lines39404142434445464748494849505152535455505138 unmodified lines - uses: actions/checkout@v2 - uses: actions/setup-python@v2 with: python-version: ${{ matrix.python }} cache: 'pip' cache-dependency-path: 'requirements/*.txt' - name: update pip run: | pip install -U wheel pip install -U setuptools python -m pip install -U pip - name: get pip cache dir id: pip-cache run: echo "::set-output name=dir::$(pip cache dir)" - name: cache pip uses: actions/cache@v2 with: path: ${{ steps.pip-cache.outputs.dir }} key: pip|${{ runner.os }}|${{ matrix.python }}|${{ hashFiles('setup.py') }}|${{ hashFiles('requirements/*.txt') }} - run: pip install tox - run: tox -e ${{ matrix.tox }}modified:.github/dependabot.yml-10 removed
12345678910111234563 unmodified linesversion: 2updates:- package-ecosystem: "pip" directory: "/requirements" target-branch: "2.0.x" versioning-strategy: "lockfile-only" schedule: interval: "monthly" day: "monday" time: "16:00" timezone: "UTC" open-pull-requests-limit: 99- package-ecosystem: "github-actions" directory: "/" schedule: interval: "monthly"3 unmodified linesmodified:docs/patterns/appfactories.rst+14 added
96 unmodified lines97 98 $ export FLASK_APP=myapp99 $ flask run100 101+ .. group-tab:: Fish102+103+ .. code-block:: text104+105+ $ set -x FLASK_APP myapp106+ $ flask run107+108 .. group-tab:: CMD109 110 .. code-block:: text111 18 unmodified lines130 131 $ export FLASK_APP="myapp:create_app('dev')"132 $ flask run133 134+ .. group-tab:: Fish135+136+ .. code-block:: text137+138+ $ set -x FLASK_APP "myapp:create_app('dev')"139+ $ flask run140+141 .. group-tab:: CMD142 143 .. code-block:: text144 25 unmodified linesmodified:docs/patterns/packages.rst+12 added
65 unmodified lines66 .. code-block:: text67 68 $ export FLASK_APP=yourapplication69 70+ .. group-tab:: Fish71+72+ .. code-block:: text73+74+ $ set -x FLASK_APP yourapplication75+76 .. group-tab:: CMD77 78 .. code-block:: text79 16 unmodified lines96 .. code-block:: text97 98 $ export FLASK_ENV=development99 100+ .. group-tab:: Fish101+102+ .. code-block:: text103+104+ $ set -x FLASK_ENV development105+106 .. group-tab:: CMD107 108 .. code-block:: text109 78 unmodified linesmodified:docs/tutorial/deploy.rst+7 added
55 unmodified lines56 57 $ export FLASK_APP=flaskr58 $ flask init-db59 60+ .. group-tab:: Fish61+62+ .. code-block:: text63+64+ $ set -x FLASK_APP flaskr65+ $ flask init-db66+67 .. group-tab:: CMD68 69 .. code-block:: text70 76 unmodified linesmodified:docs/tutorial/factory.rst+8 added
143 unmodified lines144 $ export FLASK_APP=flaskr145 $ export FLASK_ENV=development146 $ flask run147 148+ .. group-tab:: Fish149+150+ .. code-block:: text151+152+ $ set -x FLASK_APP flaskr153+ $ set -x FLASK_ENV development154+ $ flask run155+156 .. group-tab:: CMD157 158 .. code-block:: text159 34 unmodified linesmodified:docs/cli.rst+53 added
25 unmodified lines26 27 $ export FLASK_APP=hello28 $ flask run29 30+ .. group-tab:: Fish31+32+ .. code-block:: text33+34+ $ set -x FLASK_APP hello35+ $ flask run36+37 .. group-tab:: CMD38 39 .. code-block:: text40 121 unmodified lines162 * Restarting with inotify reloader163 * Debugger is active!164 * Debugger PIN: 223-456-919165 166+ .. group-tab:: Fish167+168+ .. code-block:: text169+170+ $ set -x FLASK_ENV development171+ $ flask run172+ * Serving Flask app "hello"173+ * Environment: development174+ * Debug mode: on175+ * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)176+ * Restarting with inotify reloader177+ * Debugger is active!178+ * Debugger PIN: 223-456-919179+180 .. group-tab:: CMD181 182 .. code-block:: text183 43 unmodified lines227 $ flask run228 * Running on http://127.0.0.1:8000/229 * Detected change in '/path/to/file1', reloading230 231+ .. group-tab:: Fish232+233+ .. code-block:: text234+235+ $ flask run --extra-files file1:dirA/file2:dirB/236+ # or237+ $ set -x FLASK_RUN_EXTRA_FILES file1 dirA/file2 dirB/238+ $ flask run239+ * Running on http://127.0.0.1:8000/240+ * Detected change in '/path/to/file1', reloading241+242 .. group-tab:: CMD243 244 .. code-block:: text245 72 unmodified lines318 $ export FLASK_RUN_PORT=8000319 $ flask run320 * Running on http://127.0.0.1:8000/321 322+ .. group-tab:: Fish323+324+ .. code-block:: text325+326+ $ set -x FLASK_RUN_PORT 8000327+ $ flask run328+ * Running on http://127.0.0.1:8000/329+330 .. group-tab:: CMD331 332 .. code-block:: text333 39 unmodified lines373 374 $ export FLASK_SKIP_DOTENV=1375 $ flask run376 377+ .. group-tab:: Fish378+379+ .. code-block:: text380+381+ $ set -x FLASK_SKIP_DOTENV 1382+ $ flask run383+384 .. group-tab:: CMD385 386 .. code-block:: text387 22 unmodified lines410 Unix Bash, :file:`venv/bin/activate`::411 412 $ export FLASK_APP=hello413 414+ .. group-tab:: Fish415+416+ Fish, :file:`venv/bin/activate.fish`::417+418+ $ set -x FLASK_APP hello419+420 .. group-tab:: CMD421 422 Windows CMD, :file:`venv\\Scripts\\activate.bat`::423 288 unmodified linesmodified:docs/config.rst+24 added
74 unmodified lines75 76 $ export FLASK_ENV=development77 $ flask run78 79+ .. group-tab:: Fish80+81+ .. code-block:: text82+83+ $ set -x FLASK_ENV development84+ $ flask run85+86 .. group-tab:: CMD87 88 .. code-block:: text89 361 unmodified lines451 $ export YOURAPPLICATION_SETTINGS=/path/to/settings.cfg452 $ flask run453 * Running on http://127.0.0.1:5000/454 455+ .. group-tab:: Fish456+457+ .. code-block:: text458+459+ $ set -x YOURAPPLICATION_SETTINGS /path/to/settings.cfg460+ $ flask run461+ * Running on http://127.0.0.1:5000/462+463 .. group-tab:: CMD464 465 .. code-block:: text466 64 unmodified lines531 $ export MAIL_ENABLED=false532 $ flask run533 * Running on http://127.0.0.1:5000/534 535+ .. group-tab:: Fish536+537+ .. code-block:: text538+539+ $ set -x SECRET_KEY "5f352379324c22463451387a0aec5d2f"540+ $ set -x MAIL_ENABLED false541+ $ flask run542+ * Running on http://127.0.0.1:5000/543+544 .. group-tab:: CMD545 546 .. code-block:: text547 245 unmodified linesmodified:docs/debugging.rst+14 added
51 unmodified lines52 53 $ export FLASK_ENV=development54 $ flask run55 56+ .. group-tab:: Fish57+58+ .. code-block:: text59+60+ $ set -x FLASK_ENV development61+ $ flask run62+63 .. group-tab:: CMD64 65 .. code-block:: text66 45 unmodified lines112 113 $ export FLASK_ENV=development114 $ flask run --no-debugger --no-reload115 116+ .. group-tab:: Fish117+118+ .. code-block:: text119+120+ $ set -x FLASK_ENV development121+ $ flask run --no-debugger --no-reload122+123 .. group-tab:: CMD124 125 .. code-block:: text126 21 unmodified linesmodified:docs/quickstart.rst+15 added
52 unmodified lines53 $ export FLASK_APP=hello54 $ flask run55 * Running on http://127.0.0.1:5000/56 57+ .. group-tab:: Fish58+59+ .. code-block:: text60+61+ $ set -x FLASK_APP hello62+ $ flask run63+ * Running on http://127.0.0.1:5000/64+65 .. group-tab:: CMD66 67 .. code-block:: text68 104 unmodified lines173 174 $ export FLASK_ENV=development175 $ flask run176 177+ .. group-tab:: Fish178+179+ .. code-block:: text180+181+ $ set -x FLASK_ENV development182+ $ flask run183+184 .. group-tab:: CMD185 186 .. code-block:: text187 771 unmodified linesmodified:docs/security.rst-12 removed
171 unmodified lines172 response.headers['X-Frame-Options'] = 'SAMEORIGIN'173 174 - https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options175 176-X-XSS-Protection177-~~~~~~~~~~~~~~~~178-179-The browser will try to prevent reflected XSS attacks by not loading the page180-if the request contains something that looks like JavaScript and the response181-contains the same data. ::182-183- response.headers['X-XSS-Protection'] = '1; mode=block'184-185-- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection186-187-176 .. _security-cookie:177 178 Set-Cookie options179 ~~~~~~~~~~~~~~~~~~95 unmodified linesmodified:docs/server.rst+8 added
31 unmodified lines32 $ export FLASK_APP=hello33 $ export FLASK_ENV=development34 $ flask run35 36+ .. group-tab:: Fish37+38+ .. code-block:: text39+40+ $ set -x FLASK_APP hello41+ $ export FLASK_ENV=development42+ $ flask run43+44 .. group-tab:: CMD45 46 .. code-block:: text47 118 unmodified linesmodified:requirements/dev.in+1 added-1 removed
1 -r docs.in2 -r tests.in3 -r typing.in4-pip-tools4+pip-compile-multi5 pre-commit6 toxmodified:requirements/dev.txt+17 added-121 removed
1+# SHA1:54b5b77ec8c7a0064ffa93b2fd16cb0130ba177c2 #2-# This file is autogenerated by pip-compile with python 3.103+# This file is autogenerated by pip-compile-multi4 # To update, run:5 #5-# pip-compile requirements/dev.in6+# pip-compile-multi7 #7-alabaster==0.7.128- # via sphinx9-asgiref==3.4.110- # via -r requirements/tests.in11-attrs==21.4.012- # via pytest13-babel==2.9.114- # via sphinx15-blinker==1.416- # via -r requirements/tests.in17-certifi==2021.10.818- # via requests19-cffi==1.15.020- # via cryptography8+-r docs.txt9+-r tests.txt10+-r typing.txt11 cfgv==3.3.112 # via pre-commit23-charset-normalizer==2.0.1024- # via requests13 click==8.0.326- # via pip-tools27-cryptography==36.0.128- # via -r requirements/typing.in14+ # via15+ # pip-compile-multi16+ # pip-tools17 distlib==0.3.418 # via virtualenv31-docutils==0.1632- # via33- # sphinx34- # sphinx-tabs19 filelock==3.4.220 # via21 # tox22 # virtualenv23 greenlet==1.1.2 ; python_version < "3.11"24 # via -r requirements/tests.in41-identify==2.4.325+identify==2.4.826 # via pre-commit43-idna==3.344- # via requests45-imagesize==1.3.046- # via sphinx47-iniconfig==1.1.148- # via pytest49-jinja2==3.0.350- # via sphinx51-markupsafe==2.0.152- # via jinja253-mypy==0.93154- # via -r requirements/typing.in55-mypy-extensions==0.4.356- # via mypy27 nodeenv==1.6.028 # via pre-commit59-packaging==21.360- # via61- # pallets-sphinx-themes62- # pytest63- # sphinx64- # tox65-pallets-sphinx-themes==2.0.266- # via -r requirements/docs.in29 pep517==0.12.030 # via pip-tools69-pip-tools==6.4.031+pip-compile-multi==2.4.332 # via -r requirements/dev.in33+pip-tools==6.5.134+ # via pip-compile-multi35 platformdirs==2.4.136 # via virtualenv73-pluggy==1.0.074- # via75- # pytest76- # tox77-pre-commit==2.16.037+pre-commit==2.17.038 # via -r requirements/dev.in79-py==1.11.080- # via81- # pytest82- # tox83-pycparser==2.2184- # via cffi85-pygments==2.11.286- # via87- # sphinx88- # sphinx-tabs89-pyparsing==3.0.690- # via packaging91-pytest==6.2.592- # via -r requirements/tests.in93-python-dotenv==0.19.294- # via -r requirements/tests.in95-pytz==2021.396- # via babel39 pyyaml==6.040 # via pre-commit99-requests==2.27.1100- # via sphinx41 six==1.16.042 # via43 # tox44 # virtualenv105-snowballstemmer==2.2.0106- # via sphinx107-sphinx==4.3.2108- # via109- # -r requirements/docs.in110- # pallets-sphinx-themes111- # sphinx-issues112- # sphinx-tabs113- # sphinxcontrib-log-cabinet114-sphinx-issues==3.0.1115- # via -r requirements/docs.in116-sphinx-tabs==3.2.0117- # via -r requirements/docs.in118-sphinxcontrib-applehelp==1.0.2119- # via sphinx120-sphinxcontrib-devhelp==1.0.2121- # via sphinx122-sphinxcontrib-htmlhelp==2.0.0123- # via sphinx124-sphinxcontrib-jsmath==1.0.1125- # via sphinx126-sphinxcontrib-log-cabinet==1.0.1127- # via -r requirements/docs.in128-sphinxcontrib-qthelp==1.0.3129- # via sphinx130-sphinxcontrib-serializinghtml==1.1.5131- # via sphinx132-toml==0.10.2133- # via134- # pre-commit135- # pytest136- # tox137-tomli==2.0.0138- # via139- # mypy140- # pep51745+toposort==1.746+ # via pip-compile-multi47 tox==3.24.548 # via -r requirements/dev.in143-types-contextvars==2.4.1144- # via -r requirements/typing.in145-types-dataclasses==0.6.4146- # via -r requirements/typing.in147-types-setuptools==57.4.7148- # via -r requirements/typing.in149-typing-extensions==4.0.1150- # via mypy151-urllib3==1.26.8152- # via requests153-virtualenv==20.13.049+virtualenv==20.13.150 # via51 # pre-commit52 # tox53 wheel==0.37.15 unmodified linesmodified:requirements/docs.txt+6 added-8 removed
1+# SHA1:34fd4ca6516e97c7348e6facdd9c4ebb68209d1c2 #2-# This file is autogenerated by pip-compile with python 3.103+# This file is autogenerated by pip-compile-multi4 # To update, run:5 #5-# pip-compile requirements/docs.in6+# pip-compile-multi7 #8 alabaster==0.7.129 # via sphinx10 babel==2.9.111 # via sphinx12 certifi==2021.10.813 # via requests13-charset-normalizer==2.0.1014+charset-normalizer==2.0.1115 # via requests16 docutils==0.1617 # via18 # sphinx15 unmodified lines34 pygments==2.11.235 # via36 # sphinx37 # sphinx-tabs37-pyparsing==3.0.638+pyparsing==3.0.739 # via packaging40 pytz==2021.341 # via babel42 requests==2.27.143 # via sphinx44 snowballstemmer==2.2.045 # via sphinx45-sphinx==4.3.246+sphinx==4.4.047 # via48 # -r requirements/docs.in49 # pallets-sphinx-themes50 # sphinx-issues18 unmodified lines69 sphinxcontrib-serializinghtml==1.1.570 # via sphinx71 urllib3==1.26.872 # via requests72-73-# The following packages are considered to be unsafe in a requirements file:74-# setuptoolsmodified:requirements/tests-pallets-dev.txt+3 added-2 removed
1+# SHA1:692b640e7f835e536628f76de0afff12965241222 #2-# This file is autogenerated by pip-compile with python 3.103+# This file is autogenerated by pip-compile-multi4 # To update, run:5 #5-# pip-compile requirements/tests-pallets-dev.in6+# pip-compile-multi7 #8 click @ https://github.com/pallets/click/archive/refs/heads/main.tar.gz9 # via -r requirements/tests-pallets-dev.in10 itsdangerous @ https://github.com/pallets/itsdangerous/archive/refs/heads/main.tar.gz9 unmodified linesmodified:requirements/tests-pallets-min.txt+3 added-2 removed
1+# SHA1:4de7d9e6254a945fd97ec10880dd23b6cd43b70d2 #2-# This file is autogenerated by pip-compile with python 3.103+# This file is autogenerated by pip-compile-multi4 # To update, run:5 #5-# pip-compile requirements/tests-pallets-min.in6+# pip-compile-multi7 #8 click==8.0.09 # via -r requirements/tests-pallets-min.in10 itsdangerous==2.0.09 unmodified linesmodified:requirements/tests.in+2 added-2 removed
1-pytest2-asgiref1+pytest<72+asgiref<3.53 blinker4 greenlet ; python_version < "3.11"5 python-dotenvmodified:requirements/tests.txt+4 added-3 removed
1+# SHA1:39a475af80093ba5deaee28d9ac0851afb91b6a92 #2-# This file is autogenerated by pip-compile with python 3.103+# This file is autogenerated by pip-compile-multi4 # To update, run:5 #5-# pip-compile requirements/tests.in6+# pip-compile-multi7 #8 asgiref==3.4.19 # via -r requirements/tests.in10 attrs==21.4.09 unmodified lines20 pluggy==1.0.021 # via pytest22 py==1.11.023 # via pytest23-pyparsing==3.0.624+pyparsing==3.0.725 # via packaging26 pytest==6.2.527 # via -r requirements/tests.in28 python-dotenv==0.19.23 unmodified linesmodified:requirements/typing.txt+6 added-5 removed
1+# SHA1:7cc3f64d4e78db89d81680ac81503d5ac35d31a92 #2-# This file is autogenerated by pip-compile with python 3.103+# This file is autogenerated by pip-compile-multi4 # To update, run:5 #5-# pip-compile requirements/typing.in6+# pip-compile-multi7 #8 cffi==1.15.09 # via cryptography10 cryptography==36.0.13 unmodified lines14 mypy-extensions==0.4.315 # via mypy16 pycparser==2.2117 # via cffi17-tomli==2.0.018+tomli==2.0.119 # via mypy19-types-contextvars==2.4.120+types-contextvars==2.4.221 # via -r requirements/typing.in22 types-dataclasses==0.6.423 # via -r requirements/typing.in23-types-setuptools==57.4.724+types-setuptools==57.4.925 # via -r requirements/typing.in26 typing-extensions==4.0.127 # via mypymodified:tests/test_basic.py+10 added-3 removed
1 import gc2 import re3 import time4 import uuid5+import warnings6 import weakref7 from datetime import datetime8 from platform import python_implementation9 from threading import Thread1515 unmodified lines1525 app.config["SERVER_NAME"] = "dev.local"1526 rv = client.get("/", "https://dev.local")1527 assert rv.data == b"default"1528 1528- # suppress Werkzeug 1.0 warning about name mismatch1529- with pytest.warns(None):1529+ # suppress Werkzeug 0.15 warning about name mismatch1530+ with warnings.catch_warnings():1531+ warnings.filterwarnings(1532+ "ignore", "Current server name", UserWarning, "flask.app"1533+ )1534 rv = client.get("/", "http://foo.localhost")1535 assert rv.status_code == 4041536 1537 rv = client.get("/", "http://foo.dev.local")358 unmodified lines1896 def index():1897 return "", 2041898 1899 # suppress Werkzeug 0.15 warning about name mismatch1896- with pytest.warns(None):1900+ with warnings.catch_warnings():1901+ warnings.filterwarnings(1902+ "ignore", "Current server name", UserWarning, "flask.app"1903+ )1904 # ip address can't match name1905 rv = client.get("/", "http://127.0.0.1:3000/")1906 assert rv.status_code == 404 if matching else 2041907 126 unmodified linesmodified:tests/test_reqctx.py+6 added-1 removed
1+import warnings2+3 import pytest4 5 import flask6 from flask.sessions import SecureCookieSessionInterface75 unmodified lines82 == "http://foo.localhost.localdomain:5000/"83 )84 85 # suppress Werkzeug 0.15 warning about name mismatch84- with pytest.warns(None):86+ with warnings.catch_warnings():87+ warnings.filterwarnings(88+ "ignore", "Current server name", UserWarning, "flask.app"89+ )90 with app.test_request_context(91 "/", environ_overrides={"HTTP_HOST": "localhost"}92 ):93 pass232 unmodified linesmodified:.pre-commit-config.yaml+6 added-2 removed
6 unmodified lines7 hooks:8 - id: pyupgrade9 args: ["--py36-plus"]10 - repo: https://github.com/asottile/reorder_python_imports11- rev: v2.6.011+ rev: v2.7.112 hooks:13 - id: reorder-python-imports14 name: Reorder Python imports (src, tests)15 files: "^(?!examples/)"16 args: ["--application-directories", "src"]17 - repo: https://github.com/psf/black18- rev: 21.12b018+ rev: 22.1.019 hooks:20 - id: black21 - repo: https://github.com/PyCQA/flake822 rev: 4.0.11 unmodified line24 - id: flake825 additional_dependencies:26 - flake8-bugbear27 - flake8-implicit-str-concat28+ - repo: https://github.com/peterdemin/pip-compile-multi29+ rev: v2.4.330+ hooks:31+ - id: pip-compile-multi-verify32 - repo: https://github.com/pre-commit/pre-commit-hooks33 rev: v4.1.034 hooks:35 - id: fix-byte-order-marker2 unmodified lines