From 358ba44c73ca4eac20e140252fd5b3ca23e4f85e Mon Sep 17 00:00:00 2001 From: Morten Enemark Lund Date: Mon, 8 Dec 2025 09:57:36 +0100 Subject: [PATCH 1/3] fix: use new path argument in pytest hook This fixes a deprecation warning against pytest 9. --- anypytools/pytest_plugin.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/anypytools/pytest_plugin.py b/anypytools/pytest_plugin.py index 15a8451..b5963f1 100644 --- a/anypytools/pytest_plugin.py +++ b/anypytools/pytest_plugin.py @@ -130,11 +130,10 @@ def change_dir(path): os.chdir(prev_cwd) -def pytest_collect_file(parent, path): +def pytest_collect_file(parent, file_path): """Collect AnyScript test files.""" - path = Path(path) - if path.suffix.lower() == ".any" and path.stem.lower().startswith("test_"): - return AnyTestFile.from_parent(parent, path=path) + if file_path.suffix.lower() == ".any" and file_path.stem.lower().startswith("test_"): + return AnyTestFile.from_parent(parent, path=file_path) def _format_switches(defs): From 3daaebaaae5d32576b20b188d51de2d4453c5c84 Mon Sep 17 00:00:00 2001 From: Morten Enemark Lund Date: Mon, 8 Dec 2025 10:41:40 +0100 Subject: [PATCH 2/3] chore: update version to 1.20.2 and fix deprecation warnings for pytest --- CHANGELOG.md | 5 +++++ anypytools/__init__.py | 2 +- pixi.lock | 29 +++++++++++++++-------------- pixi.toml | 4 ++-- 4 files changed, 23 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 914b591..3f6a63c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # AnyPyTools Change Log +## v1.20.2 + +* Fixed a deprecation warning from the pytest plugin, and enable pytest 9 support. + + ## v1.20.1 * Fixed an issue with AnyPyTools when running directly in the main thread diff --git a/anypytools/__init__.py b/anypytools/__init__.py index ebcf015..5e382f5 100644 --- a/anypytools/__init__.py +++ b/anypytools/__init__.py @@ -36,7 +36,7 @@ "NORMAL_PRIORITY_CLASS", ] -__version__ = "1.20.1" +__version__ = "1.20.2" def print_versions(): diff --git a/pixi.lock b/pixi.lock index 313e4c9..192f99a 100644 --- a/pixi.lock +++ b/pixi.lock @@ -1287,7 +1287,7 @@ environments: - conda: https://prefix.dev/conda-forge/noarch/pydoe-0.3.8-py_1.tar.bz2 - conda: https://prefix.dev/conda-forge/noarch/pygments-2.19.2-pyhd8ed1ab_0.conda - conda: https://prefix.dev/conda-forge/noarch/pygments_anyscript-1.5.0-pyhd8ed1ab_1.conda - - conda: https://prefix.dev/conda-forge/noarch/pytest-8.4.2-pyhd8ed1ab_0.conda + - conda: https://prefix.dev/conda-forge/noarch/pytest-9.0.2-pyhcf101f3_0.conda - conda: https://prefix.dev/conda-forge/noarch/pytest-xdist-3.8.0-pyhd8ed1ab_0.conda - conda: https://prefix.dev/conda-forge/linux-64/python-3.13.9-hc97d973_101_cp313.conda - conda: https://prefix.dev/conda-forge/noarch/python-dateutil-2.9.0.post0-pyhe01879c_2.conda @@ -1404,7 +1404,7 @@ environments: - conda: https://prefix.dev/conda-forge/noarch/pydoe-0.3.8-py_1.tar.bz2 - conda: https://prefix.dev/conda-forge/noarch/pygments-2.19.2-pyhd8ed1ab_0.conda - conda: https://prefix.dev/conda-forge/noarch/pygments_anyscript-1.5.0-pyhd8ed1ab_1.conda - - conda: https://prefix.dev/conda-forge/noarch/pytest-8.4.2-pyhd8ed1ab_0.conda + - conda: https://prefix.dev/conda-forge/noarch/pytest-9.0.2-pyhcf101f3_0.conda - conda: https://prefix.dev/conda-forge/noarch/pytest-xdist-3.8.0-pyhd8ed1ab_0.conda - conda: https://prefix.dev/conda-forge/win-64/python-3.14.0-h4b44e0e_102_cp314.conda - conda: https://prefix.dev/conda-forge/noarch/python-dateutil-2.9.0.post0-pyhe01879c_2.conda @@ -1548,7 +1548,7 @@ packages: timestamp: 1758634638734 - conda: . name: anypytools - version: 1.20.1 + version: 1.20.2 build: pyh4616a5c_0 subdir: noarch depends: @@ -1566,7 +1566,7 @@ packages: - pywin32 license: MIT input: - hash: f4b0daf1f3076714723f62ddbe9257f4c3285e8f5f8cc790e34bdcc52bc2da6a + hash: cc5bfba51146b92c82c10a419d0bd23280b566181a189bc0afe8b21587ca882d globs: - pyproject.toml - conda: https://prefix.dev/conda-forge/win-64/aom-3.9.1-he0c23c2_0.conda @@ -5842,24 +5842,25 @@ packages: - pkg:pypi/pysocks?source=hash-mapping size: 21085 timestamp: 1733217331982 -- conda: https://prefix.dev/conda-forge/noarch/pytest-8.4.2-pyhd8ed1ab_0.conda - sha256: 41053d9893e379a3133bb9b557b98a3d2142fca474fb6b964ba5d97515f78e2d - md5: 1f987505580cb972cf28dc5f74a0f81b +- conda: https://prefix.dev/conda-forge/noarch/pytest-9.0.2-pyhcf101f3_0.conda + sha256: 9e749fb465a8bedf0184d8b8996992a38de351f7c64e967031944978de03a520 + md5: 2b694bad8a50dc2f712f5368de866480 depends: - - colorama >=0.4 - - exceptiongroup >=1 - - iniconfig >=1 - - packaging >=20 - - pluggy >=1.5,<2 - pygments >=2.7.2 - python >=3.10 + - iniconfig >=1.0.1 + - packaging >=22 + - pluggy >=1.5,<2 - tomli >=1 + - colorama >=0.4 + - exceptiongroup >=1 + - python constrains: - pytest-faulthandler >=2 license: MIT license_family: MIT - size: 276734 - timestamp: 1757011891753 + size: 299581 + timestamp: 1765062031645 - conda: https://prefix.dev/conda-forge/noarch/pytest-xdist-3.8.0-pyhd8ed1ab_0.conda sha256: b7b58a5be090883198411337b99afb6404127809c3d1c9f96e99b59f36177a96 md5: 8375cfbda7c57fbceeda18229be10417 diff --git a/pixi.toml b/pixi.toml index aa905a4..129124a 100644 --- a/pixi.toml +++ b/pixi.toml @@ -10,7 +10,7 @@ anypytools = {path= "."} [package] name = "anypytools" -version="1.20.1" +version="1.20.2" [package.build] backend = { name = "pixi-build-python", version = "*" } @@ -57,7 +57,7 @@ ipywidgets = "*" seaborn = ">=0.13.2,<0.14" [feature.test.dependencies] -pytest="*" +pytest=">=9" pytest-xdist = "*" debugpy = "*" From 2fcbef56fc346d46e866442f202c55f638a89696 Mon Sep 17 00:00:00 2001 From: Morten Enemark Lund Date: Mon, 8 Dec 2025 10:42:43 +0100 Subject: [PATCH 3/3] black formatting --- anypytools/pytest_plugin.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/anypytools/pytest_plugin.py b/anypytools/pytest_plugin.py index b5963f1..de4018a 100644 --- a/anypytools/pytest_plugin.py +++ b/anypytools/pytest_plugin.py @@ -132,7 +132,9 @@ def change_dir(path): def pytest_collect_file(parent, file_path): """Collect AnyScript test files.""" - if file_path.suffix.lower() == ".any" and file_path.stem.lower().startswith("test_"): + if file_path.suffix.lower() == ".any" and file_path.stem.lower().startswith( + "test_" + ): return AnyTestFile.from_parent(parent, path=file_path)