From b2ba126f88091d046641715225070550ee2d3a25 Mon Sep 17 00:00:00 2001 From: James Myatt Date: Wed, 9 Jul 2025 14:10:40 +0100 Subject: [PATCH 1/4] Update build matrix for current non-EOL versions --- .github/workflows/run-checks.yml | 12 ++++++------ setup.py | 2 ++ tox.ini | 3 ++- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/run-checks.yml b/.github/workflows/run-checks.yml index a83794f..840d06c 100644 --- a/.github/workflows/run-checks.yml +++ b/.github/workflows/run-checks.yml @@ -15,21 +15,21 @@ jobs: fail-fast: false matrix: os: ["ubuntu-latest", "macos-latest", "windows-latest"] - environment: ["py37", "py38", "py39", "py310", "py311", "flake8"] + environment: ["py39", "py310", "py311", "py312", "py313", "flake8"] include: - - environment: "py37" - python: "3.7" - - environment: "py38" - python: "3.8" - environment: "py39" python: "3.9" - environment: "py310" python: "3.10" - environment: "py311" python: "3.11" + - environment: "py312" + python: "3.12" + - environment: "py313" + python: "3.13" - environment: "flake8" - python: "3.7" + python: "3.9" runs-on: ${{ matrix.os }} diff --git a/setup.py b/setup.py index b7dbb38..94d4835 100644 --- a/setup.py +++ b/setup.py @@ -47,6 +47,8 @@ def read(fname): "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python", "Topic :: Software Development :: Testing", diff --git a/tox.ini b/tox.ini index bb93750..6fccfca 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py{37,38,39,310,311}-pytest{4,5,6,7},flake8 +envlist = py{37,38,39,310,311,312,313}-pytest{4,5,6,7,8},flake8 [testenv] deps = @@ -7,6 +7,7 @@ deps = pytest5: pytest>=5,<6 pytest6: pytest>=6,<7 pytest7: pytest>=7,<8 + pytest8: pytest>=8,<9 commands = pytest {posargs:tests} [testenv:flake8] From 5a22ae0e71ba148dc81fd05d134b131b720065bf Mon Sep 17 00:00:00 2001 From: James Myatt Date: Wed, 9 Jul 2025 14:16:08 +0100 Subject: [PATCH 2/4] Enable passing extra arguments to cookiecutter function --- src/pytest_cookies/plugin.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pytest_cookies/plugin.py b/src/pytest_cookies/plugin.py index 375ff4c..b036df3 100644 --- a/src/pytest_cookies/plugin.py +++ b/src/pytest_cookies/plugin.py @@ -72,7 +72,7 @@ def _new_output_dir(self): self._counter += 1 return output_dir - def bake(self, extra_context=None, template=None): + def bake(self, extra_context=None, template=None, **extra_kwargs): exception = None exit_code = 0 project_dir = None @@ -99,6 +99,7 @@ def bake(self, extra_context=None, template=None): extra_context=extra_context, output_dir=str(self._new_output_dir()), config_file=str(self._config_file), + **extra_kwargs ) except SystemExit as e: if e.code != 0: From d1ec4d5c0f49c441b4152d8e1f3aaf823024b19f Mon Sep 17 00:00:00 2001 From: James Myatt Date: Wed, 9 Jul 2025 14:25:44 +0100 Subject: [PATCH 3/4] Bump version number to 0.8.0 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 94d4835..ccc6a12 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ def read(fname): setuptools.setup( name="pytest-cookies", - version="0.7.0", + version="0.8.0", author="Raphael Pierzina", author_email="raphael@hackebrot.de", maintainer="Raphael Pierzina", From 97254f63510000fb58669a4fb285e97b1bc66b8c Mon Sep 17 00:00:00 2001 From: James Myatt Date: Wed, 9 Jul 2025 14:26:11 +0100 Subject: [PATCH 4/4] Update docs --- docs/getting_started.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/getting_started.md b/docs/getting_started.md index 71fbf87..a3b7c6b 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -31,8 +31,10 @@ def test_bake_project(cookies): It accepts the ``extra_context`` keyword argument that will be passed to cookiecutter. The given dictionary will override the default values of the template context, allowing you to test arbitrary user input data. - Please see the [Injecting Extra Context] section of the official cookiecutter documentation. +It also accepts extra keyword arguments, +which are passed directly to the cookiecutter function. + [Injecting Extra Context]: https://cookiecutter.readthedocs.io/en/latest/advanced/injecting_context.html#injecting-extra-context