Skip to content

Commit 824cee2

Browse files
district10zhixiong-tangclaude
authored
downgrade cibuildwheel v3.3.1 -> v2.22 for glibc compatibility (#31)
* downgrade cibuildwheel v3.3.1 -> v2.22 for glibc compatibility Co-Authored-By: Claude Sonnet 4 (1M context) <noreply@anthropic.com> * fix * lint * fix * fix * Revert "fix" This reverts commit d4da89f. * fix * fix --------- Co-authored-by: tang zhixiong <zhixiong.tang@momenta.ai> Co-authored-by: Claude Sonnet 4 (1M context) <noreply@anthropic.com>
1 parent 6582245 commit 824cee2

4 files changed

Lines changed: 47 additions & 31 deletions

File tree

‎.github/workflows/wheels.yml‎

Lines changed: 43 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,54 @@ jobs:
5858
~/Library/Caches/pip
5959
~/.cache/pip
6060
~/AppData/Local/pip/Cache
61-
key: cibw-pip-${{ matrix.os }}-${{ hashFiles('pyproject.toml') }}
61+
~/Library/Caches/cibuildwheel
62+
~/.cache/cibuildwheel
63+
~/AppData/Local/pypa/cibuildwheel/Cache
64+
key: cibw-${{ matrix.os }}-${{ hashFiles('pyproject.toml') }}
6265
restore-keys: |
63-
cibw-pip-${{ matrix.os }}-
66+
cibw-${{ matrix.os }}-
6467
65-
- uses: pypa/cibuildwheel@v3.3.1
68+
- uses: astral-sh/setup-uv@v7
69+
70+
- name: Pre-cache virtualenv for cibuildwheel
71+
shell: bash
72+
run: |
73+
# cibuildwheel downloads virtualenv.pyz from GitHub which can hit 429 rate limits.
74+
# Pre-download with GITHUB_TOKEN auth (5000 req/hr vs 60 unauthenticated).
75+
# Versions must match cibuildwheel v2.22 virtualenv.toml.
76+
case "$RUNNER_OS" in
77+
Windows) CACHE_DIR="$(cygpath "$USERPROFILE/AppData/Local/pypa/cibuildwheel/Cache")" ;;
78+
macOS) CACHE_DIR="$HOME/Library/Caches/cibuildwheel" ;;
79+
*) CACHE_DIR="$HOME/.cache/cibuildwheel" ;;
80+
esac
81+
mkdir -p "$CACHE_DIR"
82+
for VERSION in 20.27.1 20.21.1; do
83+
FILE="$CACHE_DIR/virtualenv-${VERSION}.pyz"
84+
if [ ! -f "$FILE" ]; then
85+
echo "Downloading virtualenv-${VERSION}.pyz..."
86+
curl -fsSL --retry 5 --retry-delay 10 --retry-all-errors \
87+
-H "Authorization: Bearer $GITHUB_TOKEN" \
88+
"https://raw.githubusercontent.com/pypa/get-virtualenv/${VERSION}/public/virtualenv.pyz" \
89+
-o "$FILE"
90+
else
91+
echo "virtualenv-${VERSION}.pyz already cached"
92+
fi
93+
done
94+
env:
95+
GITHUB_TOKEN: ${{ github.token }}
96+
97+
- uses: pypa/cibuildwheel@v2.22
6698
env:
6799
CIBW_ARCHS_MACOS: universal2
68100
CIBW_ARCHS_WINDOWS: AMD64 ARM64
69-
CIBW_BEFORE_BUILD: pip install pytest networkx --prefer-binary
70-
CIBW_SKIP: "pp* *musllinux* *_i686 cp314t-win*"
71-
CIBW_TEST_SKIP: "*macosx* *win* *aarch64 cp314t-*"
101+
CIBW_BEFORE_BUILD: >
102+
python3 -m ensurepip --upgrade &&
103+
python3 -m pip install -U pip setuptools wheel &&
104+
python3 -m pip install --prefer-binary pytest networkx
105+
CIBW_SKIP: "pp* *musllinux* *_i686"
106+
CIBW_TEST_SKIP: "*macosx* *win* *aarch64"
107+
# Use uv to avoid transient GitHub rate limits during build
108+
CIBW_BUILD_FRONTEND: "build[uv]"
72109

73110
- name: Verify clean directory
74111
run: git diff --exit-code

‎pyproject.toml‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,17 @@ build-backend = "scikit_build_core.build"
55

66
[project]
77
name = "networkx_graph"
8-
version = "0.2.6"
8+
version = "0.2.7"
99
description = "Some customized graph algorithms"
1010
readme = "README.md"
1111
authors = [
1212
{ name = "district10", email = "dvorak4tzx@gmail.com" },
1313
]
14-
requires-python = ">=3.7"
14+
requires-python = ">=3.9"
1515
classifiers = [
1616
"Development Status :: 4 - Beta",
1717
"License :: OSI Approved :: MIT License",
1818
"Programming Language :: Python :: 3 :: Only",
19-
"Programming Language :: Python :: 3.7",
20-
"Programming Language :: Python :: 3.8",
2119
"Programming Language :: Python :: 3.9",
2220
"Programming Language :: Python :: 3.10",
2321
"Programming Language :: Python :: 3.11",

‎src/networkx_graph/_core.pyi‎

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
.. autosummary::
99
:toctree: _generate
1010
11-
add
12-
subtract
13-
1411
"""
1512
from __future__ import annotations
1613

@@ -33,8 +30,6 @@ __all__: list[str] = [
3330
"UbodtRecord",
3431
"ZigzagPath",
3532
"ZigzagPathGenerator",
36-
"add",
37-
"subtract",
3833
]
3934

4035
class Bindings:
@@ -697,18 +692,4 @@ class ZigzagPathGenerator:
697692
Convert the ZigzagPathGenerator object to a dictionary
698693
"""
699694

700-
def add(arg0: int, arg1: int) -> int:
701-
"""
702-
Add two numbers
703-
704-
Some other explanation about the add function.
705-
"""
706-
707-
def subtract(arg0: int, arg1: int) -> int:
708-
"""
709-
Subtract two numbers
710-
711-
Some other explanation about the subtract function.
712-
"""
713-
714-
__version__: str = "0.2.6"
695+
__version__: str = "0.2.7"

‎tests/test_basic.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def calculate_md5(filename, block_size=4096):
3232

3333

3434
def test_version():
35-
assert m.__version__ == "0.2.6"
35+
assert m.__version__ == "0.2.7"
3636

3737

3838
def test_networkx():

0 commit comments

Comments
 (0)