From 79c6c952bfda6c7db282a49d7e9e8d52235e8d7b Mon Sep 17 00:00:00 2001 From: David Lord Date: Mon, 7 Feb 2022 09:51:38 -0800 Subject: [PATCH 1/4] update pre-commit --- .pre-commit-config.yaml | 8 ++++++-- src/werkzeug/_internal.py | 8 ++++---- src/werkzeug/debug/tbtools.py | 4 ++-- src/werkzeug/sansio/multipart.py | 4 ++-- tests/test_test.py | 4 ++-- 5 files changed, 16 insertions(+), 12 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5248e7887..eacddcd5c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,7 +8,7 @@ repos: - id: pyupgrade args: ["--py36-plus"] - repo: https://github.com/asottile/reorder_python_imports - rev: v2.6.0 + rev: v2.7.1 hooks: - id: reorder-python-imports name: Reorder Python imports (src, tests) @@ -19,7 +19,7 @@ repos: files: "^examples/" args: ["--application-directories", "examples"] - repo: https://github.com/psf/black - rev: 21.12b0 + rev: 22.1.0 hooks: - id: black - repo: https://github.com/PyCQA/flake8 @@ -29,6 +29,10 @@ repos: additional_dependencies: - flake8-bugbear - flake8-implicit-str-concat + - repo: https://github.com/peterdemin/pip-compile-multi + rev: v2.4.3 + hooks: + - id: pip-compile-multi-verify - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.1.0 hooks: diff --git a/src/werkzeug/_internal.py b/src/werkzeug/_internal.py index 7d33563ec..0c8d0d047 100644 --- a/src/werkzeug/_internal.py +++ b/src/werkzeug/_internal.py @@ -30,11 +30,11 @@ for _i in chain(range(32), range(127, 256)): _cookie_quoting_map[_i.to_bytes(1, sys.byteorder)] = f"\\{_i:03o}".encode("latin1") -_octal_re = re.compile(br"\\[0-3][0-7][0-7]") -_quote_re = re.compile(br"[\\].") -_legal_cookie_chars_re = br"[\w\d!#%&\'~_`><@,:/\$\*\+\-\.\^\|\)\(\?\}\{\=]" +_octal_re = re.compile(rb"\\[0-3][0-7][0-7]") +_quote_re = re.compile(rb"[\\].") +_legal_cookie_chars_re = rb"[\w\d!#%&\'~_`><@,:/\$\*\+\-\.\^\|\)\(\?\}\{\=]" _cookie_re = re.compile( - br""" + rb""" (?P[^=;]+) (?:\s*=\s* (?P diff --git a/src/werkzeug/debug/tbtools.py b/src/werkzeug/debug/tbtools.py index 5ffd65422..9d754aa5e 100644 --- a/src/werkzeug/debug/tbtools.py +++ b/src/werkzeug/debug/tbtools.py @@ -16,8 +16,8 @@ from ..utils import cached_property from .console import Console -_coding_re = re.compile(br"coding[:=]\s*([-\w.]+)") -_line_re = re.compile(br"^(.*?)$", re.MULTILINE) +_coding_re = re.compile(rb"coding[:=]\s*([-\w.]+)") +_line_re = re.compile(rb"^(.*?)$", re.MULTILINE) _funcdef_re = re.compile(r"^(\s*def\s)|(.*(? Date: Mon, 7 Feb 2022 09:52:17 -0800 Subject: [PATCH 2/4] use pip-compile-multi for requirements --- requirements/dev.in | 2 +- requirements/dev.txt | 136 +++++----------------------------------- requirements/docs.txt | 14 ++--- requirements/tests.in | 2 +- requirements/tests.txt | 9 +-- requirements/typing.txt | 9 +-- 6 files changed, 35 insertions(+), 137 deletions(-) diff --git a/requirements/dev.in b/requirements/dev.in index 2588467c1..99f5942f8 100644 --- a/requirements/dev.in +++ b/requirements/dev.in @@ -1,6 +1,6 @@ -r docs.in -r tests.in -r typing.in -pip-tools +pip-compile-multi pre-commit tox diff --git a/requirements/dev.txt b/requirements/dev.txt index 8806cdd8a..20de6a0e0 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -1,157 +1,55 @@ +# SHA1:54b5b77ec8c7a0064ffa93b2fd16cb0130ba177c # -# This file is autogenerated by pip-compile with python 3.10 +# This file is autogenerated by pip-compile-multi # To update, run: # -# pip-compile requirements/dev.in +# pip-compile-multi # -alabaster==0.7.12 - # via sphinx -attrs==21.4.0 - # via pytest -babel==2.9.1 - # via sphinx -certifi==2021.10.8 - # via requests -cffi==1.15.0 - # via cryptography +-r docs.txt +-r tests.txt +-r typing.txt cfgv==3.3.1 # via pre-commit -charset-normalizer==2.0.10 - # via requests click==8.0.3 - # via pip-tools -cryptography==36.0.1 - # via -r requirements/tests.in + # via + # pip-compile-multi + # pip-tools distlib==0.3.4 # via virtualenv -docutils==0.17.1 - # via sphinx filelock==3.4.2 # via # tox # virtualenv greenlet==1.1.2 ; python_version < "3.11" # via -r requirements/tests.in -identify==2.4.3 +identify==2.4.8 # via pre-commit -idna==3.3 - # via requests -imagesize==1.3.0 - # via sphinx -iniconfig==1.1.1 - # via pytest -jinja2==3.0.3 - # via sphinx -markupsafe==2.0.1 - # via jinja2 -mypy==0.931 - # via -r requirements/typing.in -mypy-extensions==0.4.3 - # via mypy nodeenv==1.6.0 # via pre-commit -packaging==21.3 - # via - # pallets-sphinx-themes - # pytest - # sphinx - # tox -pallets-sphinx-themes==2.0.2 - # via -r requirements/docs.in pep517==0.12.0 # via pip-tools -pip-tools==6.4.0 +pip-compile-multi==2.4.3 # via -r requirements/dev.in +pip-tools==6.5.0 + # via pip-compile-multi platformdirs==2.4.1 # via virtualenv -pluggy==1.0.0 - # via - # pytest - # tox -pre-commit==2.16.0 +pre-commit==2.17.0 # via -r requirements/dev.in -psutil==5.9.0 - # via pytest-xprocess -py==1.11.0 - # via - # pytest - # tox -pycparser==2.21 - # via cffi -pygments==2.11.2 - # via sphinx -pyparsing==3.0.6 - # via packaging -pytest==6.2.5 - # via - # -r requirements/tests.in - # pytest-timeout - # pytest-xprocess -pytest-timeout==2.0.2 - # via -r requirements/tests.in -pytest-xprocess==0.18.1 - # via -r requirements/tests.in -pytz==2021.3 - # via babel pyyaml==6.0 # via pre-commit -requests==2.27.1 - # via sphinx six==1.16.0 # via # tox # virtualenv -snowballstemmer==2.2.0 - # via sphinx -sphinx==4.3.2 - # via - # -r requirements/docs.in - # pallets-sphinx-themes - # sphinx-issues - # sphinxcontrib-log-cabinet -sphinx-issues==3.0.1 - # via -r requirements/docs.in -sphinxcontrib-applehelp==1.0.2 - # via sphinx -sphinxcontrib-devhelp==1.0.2 - # via sphinx -sphinxcontrib-htmlhelp==2.0.0 - # via sphinx -sphinxcontrib-jsmath==1.0.1 - # via sphinx -sphinxcontrib-log-cabinet==1.0.1 - # via -r requirements/docs.in -sphinxcontrib-qthelp==1.0.3 - # via sphinx -sphinxcontrib-serializinghtml==1.1.5 - # via sphinx -toml==0.10.2 - # via - # pre-commit - # pytest - # tox -tomli==2.0.0 - # via - # mypy - # pep517 +toposort==1.7 + # via pip-compile-multi tox==3.24.5 # via -r requirements/dev.in -types-contextvars==2.4.1 - # via -r requirements/typing.in -types-dataclasses==0.6.4 - # via -r requirements/typing.in -types-setuptools==57.4.7 - # via -r requirements/typing.in -typing-extensions==4.0.1 - # via mypy -urllib3==1.26.8 - # via requests -virtualenv==20.13.0 +virtualenv==20.13.1 # via # pre-commit # tox -watchdog==2.1.6 - # via -r requirements/tests.in wheel==0.37.1 # via pip-tools diff --git a/requirements/docs.txt b/requirements/docs.txt index da7d6e2f5..8d714854c 100644 --- a/requirements/docs.txt +++ b/requirements/docs.txt @@ -1,8 +1,9 @@ +# SHA1:45c590f97fe95b8bdc755eef796e91adf5fbe4ea # -# This file is autogenerated by pip-compile with python 3.10 +# This file is autogenerated by pip-compile-multi # To update, run: # -# pip-compile requirements/docs.in +# pip-compile-multi # alabaster==0.7.12 # via sphinx @@ -10,7 +11,7 @@ babel==2.9.1 # via sphinx certifi==2021.10.8 # via requests -charset-normalizer==2.0.10 +charset-normalizer==2.0.11 # via requests docutils==0.17.1 # via sphinx @@ -30,7 +31,7 @@ pallets-sphinx-themes==2.0.2 # via -r requirements/docs.in pygments==2.11.2 # via sphinx -pyparsing==3.0.6 +pyparsing==3.0.7 # via packaging pytz==2021.3 # via babel @@ -38,7 +39,7 @@ requests==2.27.1 # via sphinx snowballstemmer==2.2.0 # via sphinx -sphinx==4.3.2 +sphinx==4.4.0 # via # -r requirements/docs.in # pallets-sphinx-themes @@ -62,6 +63,3 @@ sphinxcontrib-serializinghtml==1.1.5 # via sphinx urllib3==1.26.8 # via requests - -# The following packages are considered to be unsafe in a requirements file: -# setuptools diff --git a/requirements/tests.in b/requirements/tests.in index c12fb58f3..0731effaa 100644 --- a/requirements/tests.in +++ b/requirements/tests.in @@ -1,4 +1,4 @@ -pytest +pytest<7 pytest-timeout pytest-xprocess cryptography diff --git a/requirements/tests.txt b/requirements/tests.txt index 0c620ccd2..95b7b4ed7 100644 --- a/requirements/tests.txt +++ b/requirements/tests.txt @@ -1,8 +1,9 @@ +# SHA1:36b07d36a8395bd7fd19df122dcf5e9d884d4922 # -# This file is autogenerated by pip-compile with python 3.10 +# This file is autogenerated by pip-compile-multi # To update, run: # -# pip-compile requirements/tests.in +# pip-compile-multi # attrs==21.4.0 # via pytest @@ -24,14 +25,14 @@ py==1.11.0 # via pytest pycparser==2.21 # via cffi -pyparsing==3.0.6 +pyparsing==3.0.7 # via packaging pytest==6.2.5 # via # -r requirements/tests.in # pytest-timeout # pytest-xprocess -pytest-timeout==2.0.2 +pytest-timeout==2.1.0 # via -r requirements/tests.in pytest-xprocess==0.18.1 # via -r requirements/tests.in diff --git a/requirements/typing.txt b/requirements/typing.txt index fb21e6964..6d868f7c7 100644 --- a/requirements/typing.txt +++ b/requirements/typing.txt @@ -1,8 +1,9 @@ +# SHA1:95499f7e92b572adde012b13e1ec99dbbb2f7089 # -# This file is autogenerated by pip-compile with python 3.10 +# This file is autogenerated by pip-compile-multi # To update, run: # -# pip-compile requirements/typing.in +# pip-compile-multi # mypy==0.931 # via -r requirements/typing.in @@ -10,11 +11,11 @@ mypy-extensions==0.4.3 # via mypy tomli==2.0.0 # via mypy -types-contextvars==2.4.1 +types-contextvars==2.4.2 # via -r requirements/typing.in types-dataclasses==0.6.4 # via -r requirements/typing.in -types-setuptools==57.4.7 +types-setuptools==57.4.9 # via -r requirements/typing.in typing-extensions==4.0.1 # via mypy From 8ec56826fcc5b34c375659a1c7078c8d725d73ba Mon Sep 17 00:00:00 2001 From: David Lord Date: Mon, 7 Feb 2022 09:52:59 -0800 Subject: [PATCH 3/4] cache pip with setup-python action --- .github/workflows/tests.yaml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 4e48dd9cd..680092ac8 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -39,19 +39,13 @@ jobs: - 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') }} - name: cache mypy uses: actions/cache@v2 with: From 98c058a1cac266a81547a415abb95a5fceb0c5df Mon Sep 17 00:00:00 2001 From: David Lord Date: Mon, 7 Feb 2022 09:53:18 -0800 Subject: [PATCH 4/4] stop using dependabot for python, too noisy --- .github/dependabot.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index b0251c75a..90f94bc32 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,15 +1,5 @@ version: 2 updates: -- 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: