Skip to content

Commit 3c8d32f

Browse files
committed
fix: prevent pyzmq compilation during tests
- Cap pyzmq version to <27 for manylinux2014 compatibility - Pre-install pyzmq binary wheel before tests using CIBW_BEFORE_TEST - Force pip to use only binary wheels with --only-binary :all:
1 parent b8ff00f commit 3c8d32f

File tree

5 files changed

+76
-9
lines changed

5 files changed

+76
-9
lines changed

.github/workflows/build-cibuildwheel.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ jobs:
6868
CIBW_BEFORE_ALL_MACOS: |
6969
brew install boost zeromq openblas cmake libomp
7070
71+
# Pre-install test dependencies to avoid compilation
72+
CIBW_BEFORE_TEST: |
73+
pip install --only-binary :all: "pyzmq>=23.0.0,<27"
74+
7175
# Test command to verify the wheel works
7276
CIBW_TEST_COMMAND: |
7377
python -c "import leann_backend_hnsw; print('HNSW backend imported successfully')"
@@ -125,15 +129,19 @@ jobs:
125129
CIBW_BEFORE_ALL_MACOS: |
126130
brew install boost zeromq openblas cmake libomp
127131
132+
# Pre-install test dependencies to avoid compilation
133+
CIBW_BEFORE_TEST: |
134+
pip install --only-binary :all: "pyzmq>=23.0.0,<27"
135+
128136
# Test command to verify the wheel works
129137
CIBW_TEST_COMMAND: |
130138
python -c "import leann_backend_diskann; print('DiskANN backend imported successfully')"
131139
132140
# Skip problematic configurations
133141
CIBW_TEST_SKIP: "*-macosx_arm64" # Skip ARM64 tests on GitHub Actions
134142

135-
# Test dependencies - install pre-built pyzmq to avoid compilation issues
136-
CIBW_TEST_REQUIRES: "pytest numpy pyzmq"
143+
# Test dependencies - avoid pyzmq due to manylinux2014 compatibility issues
144+
CIBW_TEST_REQUIRES: "pytest numpy"
137145

138146
CIBW_ENVIRONMENT: |
139147
CMAKE_BUILD_PARALLEL_LEVEL=8

check_pyzmq_wheels.py

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/usr/bin/env python3
2+
"""Check which pyzmq versions have manylinux2014 wheels available."""
3+
4+
import json
5+
import urllib.request
6+
7+
8+
def check_pyzmq_wheels():
9+
url = "https://pypi.org/pypi/pyzmq/json"
10+
with urllib.request.urlopen(url) as response:
11+
data = json.loads(response.read())
12+
13+
versions_with_manylinux2014 = {}
14+
15+
for version, releases in data["releases"].items():
16+
manylinux_wheels = []
17+
for release in releases:
18+
filename = release["filename"]
19+
if "manylinux2014" in filename or "manylinux_2_17" in filename:
20+
if "cp310" in filename: # Python 3.10
21+
manylinux_wheels.append(filename)
22+
23+
if manylinux_wheels:
24+
versions_with_manylinux2014[version] = manylinux_wheels
25+
26+
# Sort versions
27+
from packaging.version import parse
28+
29+
sorted_versions = sorted(
30+
versions_with_manylinux2014.keys(), key=parse, reverse=True
31+
)
32+
33+
print("PyZMQ versions with manylinux2014 wheels for Python 3.10:")
34+
for version in sorted_versions[:10]: # Show top 10
35+
print(f" {version}")
36+
for wheel in versions_with_manylinux2014[version]:
37+
print(f" - {wheel}")
38+
39+
40+
if __name__ == "__main__":
41+
check_pyzmq_wheels()

packages/leann-backend-hnsw/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ description = "Custom-built HNSW (Faiss) backend for the Leann toolkit."
1111
dependencies = [
1212
"leann-core==0.1.8",
1313
"numpy",
14-
"pyzmq>=23.0.0",
14+
"pyzmq>=23.0.0,<27", # Cap at 26.x for manylinux2014 compatibility
1515
"msgpack>=1.0.0",
1616
]
1717

packages/leann-core/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ dependencies = [
1515
"numpy>=1.20.0",
1616
"tqdm>=4.60.0",
1717
"psutil>=5.8.0",
18-
"pyzmq>=23.0.0",
18+
"pyzmq>=23.0.0,<27", # Cap at 26.x for manylinux2014 compatibility
1919
"msgpack>=1.0.0",
2020
"torch>=2.0.0",
2121
"sentence-transformers>=2.2.0",

uv.lock

Lines changed: 23 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)