Skip to content

Commit cbff329

Browse files
authored
PYTHON-4349 Fix snappy support on PyPy 3.8 (#1579)
1 parent c8727e9 commit cbff329

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.evergreen/run-tests.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ AUTH=${AUTH:-noauth}
3232
SSL=${SSL:-nossl}
3333
TEST_ARGS="${*:1}"
3434
PYTHON=$(which python)
35+
# TODO: Remove when we drop PyPy 3.8 support.
36+
OLD_PYPY=$(python -c "import sys; print(sys.implementation.name.lower() == 'pypy' and sys.implementation.version < (7, 3, 12))")
37+
3538
export PIP_QUIET=1 # Quiet by default
3639
export PIP_PREFER_BINARY=1 # Prefer binary dists by default
3740

@@ -110,6 +113,9 @@ fi
110113

111114
if [ "$COMPRESSORS" = "snappy" ]; then
112115
python -m pip install '.[snappy]'
116+
if [ "$OLD_PYPY" == "True" ]; then
117+
pip install "python-snappy<0.7.0"
118+
fi
113119
PYTHON=python
114120
elif [ "$COMPRESSORS" = "zstd" ]; then
115121
python -m pip install zstandard
@@ -250,6 +256,9 @@ fi
250256
if [ -n "$GREEN_FRAMEWORK" ]; then
251257
# Install all optional deps to ensure lazy imports are getting patched.
252258
python -m pip install -q ".[aws,encryption,gssapi,ocsp,snappy,zstd]"
259+
if [ "$OLD_PYPY" == "True" ]; then
260+
pip install "python-snappy<0.7.0"
261+
fi
253262
python -m pip install $GREEN_FRAMEWORK
254263
fi
255264

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ ocsp = [
7171
"service_identity>=18.1.0",
7272
]
7373
snappy = [
74-
"python-snappy",
74+
"python-snappy"
7575
]
7676
# PYTHON-3423 Removed in 4.3 but kept here to avoid pip warnings.
7777
srv = []

0 commit comments

Comments
 (0)