From 95e75b90f1a092bad10e0b93ef065e78dfabb227 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Thu, 14 Sep 2023 13:47:31 +0200 Subject: [PATCH 1/2] allow msgpack 1.0.6 (which has py312 wheels), fixes #7810 --- pyproject.toml | 2 +- src/borg/helpers/msgpack.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 8ca874e63..26fca4489 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,7 +30,7 @@ classifiers = [ ] license = {text="BSD"} dependencies = [ - "msgpack >=1.0.3, <=1.0.6rc1", + "msgpack >=1.0.3, <=1.0.6", "packaging", "platformdirs >=3.0.0, <4.0.0; sys_platform == 'darwin'", # for macOS: breaking changes in 3.0.0, "platformdirs >=2.6.0, <4.0.0; sys_platform != 'darwin'", # for others: 2.6+ works consistently. diff --git a/src/borg/helpers/msgpack.py b/src/borg/helpers/msgpack.py index 2cd708e17..f18cf25e8 100644 --- a/src/borg/helpers/msgpack.py +++ b/src/borg/helpers/msgpack.py @@ -209,7 +209,7 @@ def is_supported_msgpack(): if msgpack.version in []: # < add bad releases here to deny list return False - return (1, 0, 3) <= msgpack.version < (1, 0, 7) + return (1, 0, 3) <= msgpack.version <= (1, 0, 6) def get_limited_unpacker(kind): From 12e224613e9cf724f50233343296db10c1a4ea38 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Thu, 14 Sep 2023 14:47:30 +0200 Subject: [PATCH 2/2] test_is_slow_msgpack: skip test on expected slow msgpack environments --- src/borg/testsuite/helpers.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/borg/testsuite/helpers.py b/src/borg/testsuite/helpers.py index bbc3a25a3..9a09739e6 100644 --- a/src/borg/testsuite/helpers.py +++ b/src/borg/testsuite/helpers.py @@ -908,7 +908,22 @@ def test_parse_file_size_invalid(string): parse_file_size(string) -@pytest.mark.skipif(is_cygwin, reason="ignore slow msgpack on cygwin") +def expected_py_mp_slow_combination(): + """do we expect msgpack to be slow in this environment?""" + # we need to import upstream msgpack package here, not helpers.msgpack: + import msgpack + + # msgpack is slow on cygwin + if is_cygwin: + return True + # msgpack < 1.0.6 did not have py312 wheels + if sys.version_info[:2] == (3, 12) and msgpack.version < (1, 0, 6): + return True + # otherwise we expect msgpack to be fast! + return False + + +@pytest.mark.skipif(expected_py_mp_slow_combination(), reason="ignore expected slow msgpack") def test_is_slow_msgpack(): # we need to import upstream msgpack package here, not helpers.msgpack: import msgpack