From dfae97adf9d0b614acc3c8abe7c3f59d3b5e0dc5 Mon Sep 17 00:00:00 2001 From: Tobias Raabe Date: Sat, 22 Nov 2025 09:10:23 +0100 Subject: [PATCH 1/3] Fix pickle hash test for Python 3.14 compatibility Python 3.14 uses pickle protocol 5 by default (instead of protocol 4), which produces different hash values for the same pickled data. Make the test version-aware to use the correct expected hash based on the Python version. --- tests/test_nodes.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/test_nodes.py b/tests/test_nodes.py index 63ed12bd..cab6a37d 100644 --- a/tests/test_nodes.py +++ b/tests/test_nodes.py @@ -1,6 +1,7 @@ from __future__ import annotations import pickle +import sys from pathlib import Path import cloudpickle @@ -94,7 +95,15 @@ def test_hash_of_path_node(tmp_path, value, exists, expected): ("value", "exists", "expected"), [ ("0", False, None), - ("0", True, "2e81f502b7a28f824c4f1451c946b952eebe65a8521925ef8f6135ef6f422e8e"), + # Python 3.14+ uses pickle protocol 5 by default, which produces different + # hashes + ( + "0", + True, + "1973e23848344dc43a988a9b478663803cfffe1243480253f9a3cf004b14aa7c" + if sys.version_info >= (3, 14) + else "2e81f502b7a28f824c4f1451c946b952eebe65a8521925ef8f6135ef6f422e8e", + ), ], ) def test_hash_of_pickle_node(tmp_path, value, exists, expected): From 39406a6951a5712373325d244ab5fcea24f37c89 Mon Sep 17 00:00:00 2001 From: Tobias Raabe Date: Sat, 22 Nov 2025 14:38:33 +0100 Subject: [PATCH 2/3] Add changelog entry for pickle hash test --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ef53db1..da418249 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ chronological order. Releases follow [semantic versioning](https://semver.org/) releases are available on [PyPI](https://pypi.org/project/pytask) and [Anaconda.org](https://anaconda.org/conda-forge/pytask). +## Unreleased + +- {pull}`???` fixes the pickle node hash test by accounting for Python 3.14's + default pickle protocol. + ## 0.5.7 - 2025-11-22 - {pull}`721` clarifies the documentation on repeated tasks in notebooks. From 470daf3621be4ef651c0f2973200e4f2ff105cef Mon Sep 17 00:00:00 2001 From: Tobias Raabe Date: Sat, 22 Nov 2025 14:39:29 +0100 Subject: [PATCH 3/3] Reference PR number in changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da418249..cb1bf018 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ releases are available on [PyPI](https://pypi.org/project/pytask) and ## Unreleased -- {pull}`???` fixes the pickle node hash test by accounting for Python 3.14's +- {pull}`725` fixes the pickle node hash test by accounting for Python 3.14's default pickle protocol. ## 0.5.7 - 2025-11-22