From ca49517c5277aec613f2fcba80d2103b2c299ee1 Mon Sep 17 00:00:00 2001 From: "python-templates-copier-update[bot]" Date: Sun, 11 Oct 2026 11:28:25 +0000 Subject: [PATCH 1/3] Update from Copier (2026-10-11T11-28-22Z) Signed-off-by: python-templates-copier-update[bot] --- .copier-answers.yaml | 2 +- .github/workflows/build.yaml | 2 +- Makefile | 12 +++++++++++- pyproject.toml | 3 ++- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/.copier-answers.yaml b/.copier-answers.yaml index 904f700..6700009 100644 --- a/.copier-answers.yaml +++ b/.copier-answers.yaml @@ -1,5 +1,5 @@ # Changes here will be overwritten by Copier -_commit: d5da73e +_commit: '4372075' _src_path: gh:python-project-templates/base add_docs: false add_extension: python diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 6ea4d3d..bd61322 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -15,7 +15,7 @@ on: workflow_dispatch: concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true permissions: diff --git a/Makefile b/Makefile index c5043b9..e47079d 100644 --- a/Makefile +++ b/Makefile @@ -25,16 +25,26 @@ lint-py: ## lint python with ruff python -m ruff format --check copier_update lint-docs: ## lint docs with mdformat and codespell +<<<<<<< before updating python -m mdformat --check README.md python -m codespell_lib README.md +======= + python -m mdformat --check README.md $(wildcard docs/src) + python -m codespell_lib README.md $(wildcard docs/src) +>>>>>>> after updating fix-py: ## autoformat python code with ruff python -m ruff check --fix copier_update python -m ruff format copier_update fix-docs: ## autoformat docs with mdformat and codespell +<<<<<<< before updating python -m mdformat README.md python -m codespell_lib --write README.md +======= + python -m mdformat README.md $(wildcard docs/src) + python -m codespell_lib --write README.md $(wildcard docs/src) +>>>>>>> after updating lint: lint-py lint-docs ## run all linters lints: lint @@ -52,7 +62,7 @@ check-dist: ## check python sdist and wheel with check-dist check-types: ## check python types with ty ty check --python $$(which python) -checks: check-dist +checks: check-dist check-types # Alias check: checks diff --git a/pyproject.toml b/pyproject.toml index 19c55bb..5be0c58 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,6 +41,7 @@ develop = [ "codespell", "hatchling", "mdformat", + "mdformat-frontmatter", "mdformat-tables>=1", "pytest", "pytest-cov", @@ -77,7 +78,7 @@ replace = 'version = "{new_version}"' [tool.coverage.run] branch = true omit = [ - "copier_update/tests/integration/", + "copier_update/tests/integration/*", ] [tool.coverage.report] From e79c4949373cacda60583ff50f7afd42abcc92f6 Mon Sep 17 00:00:00 2001 From: Tim Paine <3105306+timkpaine@users.noreply.github.com> Date: Sun, 11 Oct 2026 10:46:36 -0400 Subject: [PATCH 2/3] Update Makefile --- Makefile | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/Makefile b/Makefile index e47079d..7fb2c0e 100644 --- a/Makefile +++ b/Makefile @@ -25,26 +25,16 @@ lint-py: ## lint python with ruff python -m ruff format --check copier_update lint-docs: ## lint docs with mdformat and codespell -<<<<<<< before updating - python -m mdformat --check README.md - python -m codespell_lib README.md -======= python -m mdformat --check README.md $(wildcard docs/src) python -m codespell_lib README.md $(wildcard docs/src) ->>>>>>> after updating fix-py: ## autoformat python code with ruff python -m ruff check --fix copier_update python -m ruff format copier_update fix-docs: ## autoformat docs with mdformat and codespell -<<<<<<< before updating - python -m mdformat README.md - python -m codespell_lib --write README.md -======= python -m mdformat README.md $(wildcard docs/src) python -m codespell_lib --write README.md $(wildcard docs/src) ->>>>>>> after updating lint: lint-py lint-docs ## run all linters lints: lint From c2ddca7f16a38c63a8134dd74a08fb4a66365f04 Mon Sep 17 00:00:00 2001 From: Tim Paine <3105306+timkpaine@users.noreply.github.com> Date: Sun, 11 Oct 2026 11:11:35 -0400 Subject: [PATCH 3/3] Make Copier updater test doubles match client types Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com> --- Makefile | 8 ++++---- copier_update/tests/test_github.py | 17 ++++++++++------- copier_update/tests/test_updater.py | 4 ++-- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 7fb2c0e..3d9b420 100644 --- a/Makefile +++ b/Makefile @@ -25,16 +25,16 @@ lint-py: ## lint python with ruff python -m ruff format --check copier_update lint-docs: ## lint docs with mdformat and codespell - python -m mdformat --check README.md $(wildcard docs/src) - python -m codespell_lib README.md $(wildcard docs/src) + python -m mdformat --check README.md $(wildcard docs/src) + python -m codespell_lib README.md $(wildcard docs/src) fix-py: ## autoformat python code with ruff python -m ruff check --fix copier_update python -m ruff format copier_update fix-docs: ## autoformat docs with mdformat and codespell - python -m mdformat README.md $(wildcard docs/src) - python -m codespell_lib --write README.md $(wildcard docs/src) + python -m mdformat README.md $(wildcard docs/src) + python -m codespell_lib --write README.md $(wildcard docs/src) lint: lint-py lint-docs ## run all linters lints: lint diff --git a/copier_update/tests/test_github.py b/copier_update/tests/test_github.py index f3f6fd7..e214a38 100644 --- a/copier_update/tests/test_github.py +++ b/copier_update/tests/test_github.py @@ -2,26 +2,29 @@ from typing import Any +from requests import Response, Session + from copier_update.github import GitHubAppClient, Installation, Repository -class FakeResponse: +class FakeResponse(Response): def __init__(self, status_code: int, data: Any) -> None: + super().__init__() self.status_code = status_code self.data = data - self.ok = 200 <= status_code < 300 - self.text = str(data) + self._content = str(data).encode() - def json(self) -> Any: + def json(self, **kwargs: Any) -> Any: return self.data -class FakeSession: +class FakeSession(Session): def __init__(self, *responses: FakeResponse) -> None: + super().__init__() self.responses = list(responses) - self.requests: list[tuple[str, str, dict[str, Any]]] = [] + self.requests: list[tuple[str, str | bytes, dict[str, Any]]] = [] - def request(self, method: str, url: str, **kwargs: Any) -> FakeResponse: + def request(self, method: str, url: str | bytes, *args: Any, **kwargs: Any) -> FakeResponse: self.requests.append((method, url, kwargs)) return self.responses.pop(0) diff --git a/copier_update/tests/test_updater.py b/copier_update/tests/test_updater.py index b9df7ef..2f0b475 100644 --- a/copier_update/tests/test_updater.py +++ b/copier_update/tests/test_updater.py @@ -6,11 +6,11 @@ import pytest -from copier_update.github import Installation, Repository +from copier_update.github import GitHubAppClient, Installation, Repository from copier_update.updater import Updater -class FakeClient: +class FakeClient(GitHubAppClient): def __init__(self, repositories: list[Repository]) -> None: self._repositories = repositories self.answers = {repository.full_name: ".copier-answers.yaml" for repository in repositories}