Skip to content

Commit 367a1a2

Browse files
committed
fix pypi build
1 parent 6e779ae commit 367a1a2

1 file changed

Lines changed: 71 additions & 4 deletions

File tree

.github/workflows/pypi.yml

Lines changed: 71 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,56 @@ jobs:
88
runs-on: ${{ matrix.os }}
99
strategy:
1010
matrix:
11-
os: [ubuntu-latest, windows-latest, macos-latest, macos-14] # macos-14 is ARM64
11+
include:
12+
# Linux
13+
- os: ubuntu-latest
14+
target: x86_64
15+
manylinux: auto
16+
# - os: ubuntu-latest
17+
# target: aarch64
18+
# manylinux: auto
19+
# # Windows
20+
# - os: windows-latest
21+
# target: x64
22+
# manylinux: false
23+
# - os: windows-latest
24+
# target: x86
25+
# manylinux: false
26+
# macOS
27+
- os: macos-latest
28+
target: x86_64
29+
manylinux: false
30+
# - os: macos-14
31+
# target: aarch64
32+
# manylinux: false
1233

1334
steps:
1435
- uses: actions/checkout@v4
1536

37+
- name: Setup Python
38+
uses: actions/setup-python@v5
39+
with:
40+
python-version: |
41+
3.11
42+
1643
- name: Build wheels
1744
uses: PyO3/maturin-action@v1
1845
with:
1946
target: ${{ matrix.target }}
2047
args: --release --out dist --features python --find-interpreter
2148
sccache: 'true'
22-
manylinux: auto
49+
manylinux: ${{ matrix.manylinux }}
50+
rust-toolchain: stable
51+
before-script-linux: |
52+
# Install any system dependencies if needed
53+
if [[ "${{ matrix.target }}" == "aarch64" ]]; then
54+
echo "Setting up cross-compilation for aarch64"
55+
fi
2356
2457
- name: Upload wheels
2558
uses: actions/upload-artifact@v4
2659
with:
27-
name: wheels-${{ matrix.os }}
60+
name: wheels-${{ matrix.os }}-${{ matrix.target }}
2861
path: dist
2962

3063
build-sdist:
@@ -33,22 +66,53 @@ jobs:
3366
steps:
3467
- uses: actions/checkout@v4
3568

69+
- name: Setup Python
70+
uses: actions/setup-python@v5
71+
with:
72+
python-version: '3.11'
73+
3674
- name: Build sdist
3775
uses: PyO3/maturin-action@v1
3876
with:
3977
command: sdist
4078
args: --out dist
79+
rust-toolchain: stable
4180

4281
- name: Upload sdist
4382
uses: actions/upload-artifact@v4
4483
with:
4584
name: wheels-sdist
4685
path: dist
4786

87+
test-wheel:
88+
name: Test built wheel
89+
runs-on: ubuntu-latest
90+
needs: [build-wheels]
91+
92+
steps:
93+
- uses: actions/checkout@v4
94+
95+
- name: Setup Python
96+
uses: actions/setup-python@v5
97+
with:
98+
python-version: '3.11'
99+
100+
- name: Download Linux wheel
101+
uses: actions/download-artifact@v4
102+
with:
103+
name: wheels-ubuntu-latest-x86_64
104+
path: dist
105+
106+
- name: Install and test wheel
107+
run: |
108+
pip install dist/*.whl
109+
python -c "from prollytree import ProllyTree; tree = ProllyTree(); tree.insert(b'test', b'value'); assert tree.find(b'test') == b'value'"
110+
echo "✅ Wheel test passed!"
111+
48112
collect-artifacts:
49113
name: Collect all artifacts
50114
runs-on: ubuntu-latest
51-
needs: [build-wheels, build-sdist]
115+
needs: [build-wheels, build-sdist, test-wheel]
52116

53117
steps:
54118
- name: Download all artifacts
@@ -64,6 +128,9 @@ jobs:
64128
ls -la dist/
65129
echo ""
66130
echo "Total artifacts: $(ls -1 dist/ | wc -l)"
131+
echo ""
132+
echo "Artifact details:"
133+
du -h dist/*
67134
68135
- name: Upload combined artifacts
69136
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)