Skip to content

Commit 0a48acd

Browse files
frostmingVoVAllen
andauthored
feat: produce ABI-agnostic wheels for python (tensorchord#1324)
* feat: producce abi3 wheels for cpython Signed-off-by: Frost Ming <[email protected]> * remove file added unexpectedly Signed-off-by: Frost Ming <[email protected]> * Forcely write py2.py3-none wheels Signed-off-by: Frost Ming <[email protected]> * Apply suggestions from code review Co-authored-by: Jinjing Zhou <[email protected]> Signed-off-by: Frost Ming <[email protected]> Signed-off-by: Frost Ming <[email protected]> Co-authored-by: Jinjing Zhou <[email protected]>
1 parent 5c65988 commit 0a48acd

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

.github/workflows/release.yml

+2
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,11 @@ jobs:
7878
env:
7979
CIBW_ARCHS_MACOS: arm64, x86_64
8080
CIBW_ARCHS_LINUX: auto64
81+
CIBW_SKIP: pp*
8182
- name: Build source distribution
8283
if: runner.os == 'Linux' # Only release source under linux to avoid conflict
8384
run: |
85+
python3 -m pip install wheel
8486
python3 setup.py sdist
8587
mv dist/*.tar.gz wheelhouse/
8688
- name: Upload to PyPI

pyproject.toml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["setuptools", "wheel"]
3+
build-backend = "setuptools.build_meta"

setup.py

+14-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
from setuptools.command.sdist import sdist
1717
from setuptools import setup, Extension, find_packages
1818
from setuptools.command.build_ext import build_ext
19+
from wheel.bdist_wheel import bdist_wheel
20+
21+
1922
import subprocess
2023
import logging
2124

@@ -53,6 +56,12 @@ def build_extension(self, ext: Extension) -> None:
5356
build_envd_if_not_found()
5457

5558

59+
class bdist_wheel_universal(bdist_wheel):
60+
def get_tag(self):
61+
*_, plat = super().get_tag()
62+
return "py2.py3", "none", plat
63+
64+
5665
class SdistCommand(sdist):
5766
def run(self):
5867
errno = subprocess.call(["make", "generate-git-tag-info"])
@@ -110,5 +119,9 @@ def get_version():
110119
ext_modules=[
111120
EnvdExtension(name="envd", sources=["cmd/*"]),
112121
],
113-
cmdclass=dict(build_ext=EnvdBuildExt, sdist=SdistCommand),
122+
cmdclass=dict(
123+
build_ext=EnvdBuildExt,
124+
sdist=SdistCommand,
125+
bdist_wheel=bdist_wheel_universal,
126+
),
114127
)

0 commit comments

Comments
 (0)