Skip to content

Commit 5993068

Browse files
committed
Fix conda build workflow for PyPI-compatible wheels
- Use python -m build instead of setup.py bdist_wheel for PEP 517 compliance - Pin setuptools<69.3 to avoid Metadata-Version 2.4 (PyPI only supports up to 2.3) - Update numpy requirement to >=1.23,<2.0 for Python 3.11 compatibility - Use auditwheel --plat auto for automatic manylinux tag detection
1 parent 918efee commit 5993068

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

.github/workflows/conda-build.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,23 @@ jobs:
5050
echo "USE_BAZEL_VERSION=6.5.0" >> $GITHUB_ENV
5151
bazel --version
5252
53+
- name: Install build tooling
54+
shell: bash -l {0}
55+
run: |
56+
python -m pip install --upgrade pip build wheel "setuptools<69.3"
57+
5358
- name: Build the package
5459
shell: bash -l {0}
5560
run: |
56-
python setup.py bdist_wheel
61+
python -m build --wheel --no-isolation
5762
58-
- name: Repair wheel (Linux)
63+
- name: Repair wheel for manylinux
5964
if: runner.os == 'Linux'
6065
shell: bash -l {0}
6166
run: |
67+
python -m pip install auditwheel
6268
WHEEL_PATH="$(ls dist/*.whl)"
63-
WHEEL_DIR=$(dirname "${WHEEL_PATH}")
64-
auditwheel repair --plat manylinux2014_x86_64 -w "${WHEEL_DIR}" "${WHEEL_PATH}"
69+
auditwheel repair --plat auto -w dist "${WHEEL_PATH}"
6570
rm "${WHEEL_PATH}"
6671
6772
- name: Upload wheel artifact

ci/environment.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ channels:
44
- conda-forge
55
dependencies:
66
# Note: Bazel is installed separately via official installer (conda package is unreliable)
7-
- setuptools
7+
- setuptools<69.3 # Pin to avoid Metadata-Version 2.4 (PyPI only supports up to 2.3)
88
- wheel
99
- pip
10-
- numpy
10+
- numpy>=1.23,<2.0
1111
- pytest
1212
- pytest-cov
1313
- patchelf # For wheel repair on Linux

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ requires = [
1717
"setuptools",
1818
"wheel",
1919
# Required for using org_tensorflow bazel repository.
20-
"numpy~=1.22.0",
20+
"numpy>=1.23,<2.0",
2121
]
2222

2323
[tool.pytest.ini_options]

0 commit comments

Comments
 (0)