Skip to content

Commit d314ab9

Browse files
authored
Enforce the extension module in setup.py
Without this change, [cibuildwheel](https://github.com/pypa/cibuildwheel) cannot build a correct wheel from the generated project. The problem is that the native lib is added by `MANIFEST.in` and `python3 -m pip wheel` ignores it and thinks that the package is pure Python. Thefore it builds a pure wheel and the packaging pipeline crashes.
1 parent 5271841 commit d314ab9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pkgsetup.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ const (
1919
with open("README.md", "r") as fh:
2020
long_description = fh.read()
2121
22+
23+
class BinaryDistribution(setuptools.Distribution):
24+
def has_ext_modules(_):
25+
return True
26+
27+
2228
setuptools.setup(
2329
name="%[1]s%[2]s",
2430
version="%[3]s",
@@ -35,6 +41,7 @@ setuptools.setup(
3541
"Operating System :: OS Independent",
3642
],
3743
include_package_data=True,
44+
distclass=BinaryDistribution,
3845
)
3946
`
4047

0 commit comments

Comments
 (0)