Skip to content

Commit

Permalink
Merge pull request #7823 from ThomasWaldmann/allow-msgpack-106-master
Browse files Browse the repository at this point in the history
allow msgpack 1.0.6 (which has py312 wheels), fixes #7810
  • Loading branch information
ThomasWaldmann committed Sep 14, 2023
2 parents 2943d1c + 12e2246 commit 4e8cc05
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/borg/helpers/msgpack.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
17 changes: 16 additions & 1 deletion src/borg/testsuite/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4e8cc05

Please sign in to comment.