From eb1f8af09339c65863225679e2635cb50119faaf Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Fri, 24 Jan 2025 04:56:01 +0100 Subject: [PATCH 1/7] =?UTF-8?q?=F0=9F=93=8C=20Bump=20main=20runtime=20to?= =?UTF-8?q?=20Python=203.13=20=F0=9F=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 4 ++-- requirements/runtime.txt | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3f9f4b8..5fb7097 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.12-slim +FROM python:3.13-slim LABEL "maintainer" "Sviatoslav Sydorenko " LABEL "repository" "https://github.com/pypa/gh-action-pypi-publish" @@ -12,7 +12,7 @@ ENV PIP_NO_CACHE_DIR 1 ENV PIP_ROOT_USER_ACTION ignore ENV PATH "/root/.local/bin:${PATH}" -ENV PYTHONPATH "/root/.local/lib/python3.12/site-packages" +ENV PYTHONPATH "/root/.local/lib/python3.13/site-packages" COPY requirements requirements RUN \ diff --git a/requirements/runtime.txt b/requirements/runtime.txt index 303cc3c..f472fcd 100644 --- a/requirements/runtime.txt +++ b/requirements/runtime.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.12 +# This file is autogenerated by pip-compile with Python 3.13 # by the following command: # # pip-compile --allow-unsafe --config=../.pip-tools.toml --output-file=runtime.txt --strip-extras runtime.in @@ -147,7 +147,6 @@ typing-extensions==4.12.2 # via # pydantic # pydantic-core - # pyopenssl urllib3==2.3.0 # via # requests From 8d4bfa79307546290979cc55ad06b8de67ef9f10 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Fri, 24 Jan 2025 05:03:07 +0100 Subject: [PATCH 2/7] =?UTF-8?q?=F0=9F=93=A6=20Stop=20relying=20on=20`pip-w?= =?UTF-8?q?ith-requires-python`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- requirements/runtime-prerequisites.in | 2 +- requirements/runtime-prerequisites.txt | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/requirements/runtime-prerequisites.in b/requirements/runtime-prerequisites.in index 02a2071..a1b589e 100644 --- a/requirements/runtime-prerequisites.in +++ b/requirements/runtime-prerequisites.in @@ -1 +1 @@ -pip-with-requires-python +pip diff --git a/requirements/runtime-prerequisites.txt b/requirements/runtime-prerequisites.txt index 1839741..5d0d7fd 100644 --- a/requirements/runtime-prerequisites.txt +++ b/requirements/runtime-prerequisites.txt @@ -1,12 +1,10 @@ # -# This file is autogenerated by pip-compile with Python 3.12 +# This file is autogenerated by pip-compile with Python 3.13 # by the following command: # # pip-compile --allow-unsafe --config=../.pip-tools.toml --output-file=runtime-prerequisites.txt --strip-extras runtime-prerequisites.in # -pip-with-requires-python==1.0.1 - # via -r runtime-prerequisites.in # The following packages are considered to be unsafe in a requirements file: -pip==24.0 - # via pip-with-requires-python +pip==24.3.1 + # via -r runtime-prerequisites.in From fdabf0bcb6fd593dc089ad81039d1e33b4a873e1 Mon Sep 17 00:00:00 2001 From: Kurt McKee Date: Thu, 30 Jan 2025 07:36:57 -0600 Subject: [PATCH 3/7] Update pre-commit hooks and `additional_dependencies` This addresses a small number of issues: * isort 6 resolves pre-commit deprecation warnings about its use of hook names * Several additional dependencies have new major versions * A `language_version` was set to accommodate a flake8 plugin that is no longer listed in `additional_dependencies` After these changes, no new warnings or errors appeared when running `pre-commit run -a`. --- .pre-commit-config.yaml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3c1009e..72a7a0c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,7 +10,7 @@ repos: - id: add-trailing-comma - repo: https://github.com/PyCQA/isort.git - rev: 5.13.2 + rev: 6.0.0 hooks: - id: isort args: @@ -22,7 +22,7 @@ repos: - id: remove-tabs - repo: https://github.com/python-jsonschema/check-jsonschema.git - rev: 0.29.2 + rev: 0.31.1 hooks: - id: check-github-actions - id: check-github-workflows @@ -37,7 +37,7 @@ repos: - id: check-readthedocs - repo: https://github.com/pre-commit/pre-commit-hooks.git - rev: v4.6.0 + rev: v5.0.0 hooks: # Side-effects: - id: end-of-file-fixer @@ -62,7 +62,7 @@ repos: language_version: python3 - repo: https://github.com/codespell-project/codespell - rev: v2.2.6 + rev: v2.4.1 hooks: - id: codespell @@ -78,7 +78,7 @@ repos: - --strict - repo: https://github.com/PyCQA/flake8.git - rev: 7.0.0 + rev: 7.1.1 hooks: - id: flake8 args: @@ -111,13 +111,12 @@ repos: WPS453, - --max-module-members=8 # WPS202 additional_dependencies: - - flake8-2020 ~= 1.7.0 - - flake8-pytest-style ~= 1.6.0 - - wemake-python-styleguide ~= 0.19.0 - language_version: python3.11 # flake8-commas doesn't work w/ Python 3.12 + - flake8-2020 ~= 1.8.1 + - flake8-pytest-style ~= 2.1.0 + - wemake-python-styleguide ~= 1.0.0 - repo: https://github.com/PyCQA/pylint.git - rev: v3.3.0 + rev: v3.3.4 hooks: - id: pylint args: From b223cbbc63a3e911c7e6093d72760c29bef664f4 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Thu, 20 Feb 2025 16:37:55 +0100 Subject: [PATCH 4/7] Fix duplicate attestations error message to be a str, not a tuple The bug was initially introduced in #315. Ref #339. --- attestations.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/attestations.py b/attestations.py index 69cc3fb..41f2752 100644 --- a/attestations.py +++ b/attestations.py @@ -82,8 +82,8 @@ def assert_attestations_do_not_pre_exist( existing_attestations_list = '\n'.join(map(str, existing_attestations)) error_message = ( - 'The following distributions already have publish attestations:' - f'{existing_attestations_list}', + 'The following distributions already have publish attestations: ' + f'{existing_attestations_list}' ) die(error_message) From 64aa2b5f00e8fe70061df9c41eba116778acc166 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Thu, 20 Feb 2025 16:49:46 +0100 Subject: [PATCH 5/7] =?UTF-8?q?=F0=9F=A7=AA=20Disallow=20PRs=20against=20n?= =?UTF-8?q?on-default=20branches?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/reusable-smoke-test.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/reusable-smoke-test.yml b/.github/workflows/reusable-smoke-test.yml index 969c768..54ea9a5 100644 --- a/.github/workflows/reusable-smoke-test.yml +++ b/.github/workflows/reusable-smoke-test.yml @@ -26,6 +26,19 @@ env: PYTEST_THEME_MODE jobs: + legit-pr: + + runs-on: ubuntu-latest + + timeout-minutes: 1 + + steps: + - name: Fail on PRs against illegal branches + if: >- + github.event_name == 'pull_request' + && github.ref_name == github.event.repository.default_branch + run: exit 1 + fail-fast: strategy: From 18091aeee174c9b61c3cead1305320eb3bca1fe8 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Thu, 20 Feb 2025 16:57:44 +0100 Subject: [PATCH 6/7] =?UTF-8?q?=F0=9F=A7=AA=20Use=20`base=5Fref`=20@=20PR?= =?UTF-8?q?=20base=20sanity=20check?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/reusable-smoke-test.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/reusable-smoke-test.yml b/.github/workflows/reusable-smoke-test.yml index 54ea9a5..5a77d74 100644 --- a/.github/workflows/reusable-smoke-test.yml +++ b/.github/workflows/reusable-smoke-test.yml @@ -35,8 +35,11 @@ jobs: steps: - name: Fail on PRs against illegal branches if: >- - github.event_name == 'pull_request' - && github.ref_name == github.event.repository.default_branch + github.event_name == 'pull_request' && + github.base_ref == format( + 'refs/heads/{0}', + github.event.repository.default_branch + ) run: exit 1 fail-fast: From bdf1016c661752113492a792d317a882bd9c67a9 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Thu, 20 Feb 2025 17:00:20 +0100 Subject: [PATCH 7/7] =?UTF-8?q?=F0=9F=A7=AA=20Log=20`base=5Fref`=20@=20GHA?= =?UTF-8?q?=20runs=20for=20PRs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/reusable-smoke-test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/reusable-smoke-test.yml b/.github/workflows/reusable-smoke-test.yml index 5a77d74..f2b84ab 100644 --- a/.github/workflows/reusable-smoke-test.yml +++ b/.github/workflows/reusable-smoke-test.yml @@ -33,6 +33,10 @@ jobs: timeout-minutes: 1 steps: + - name: Fail on PRs against illegal branches + if: github.event_name == 'pull_request' + run: echo github.base_ref='"${{ github.base_ref }}"' + - name: Fail on PRs against illegal branches if: >- github.event_name == 'pull_request' &&