From f3a21f98a043f624328fce3c3e11cfdbf7fff4ba Mon Sep 17 00:00:00 2001 From: Rahul Sharma Date: Fri, 7 Aug 2026 10:56:06 +0530 Subject: [PATCH 1/2] fix native wheel platform tag --- pyproject.toml | 4 ++++ setup.py | 11 +++++++++++ test.sh | 11 +++++++++++ 3 files changed, 26 insertions(+) create mode 100644 setup.py diff --git a/pyproject.toml b/pyproject.toml index 8bb946933..11076ff06 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,6 +13,10 @@ classifiers = [ ] dependencies = [] +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + [project.optional-dependencies] dev = [ "setuptools", # for distutils diff --git a/setup.py b/setup.py new file mode 100644 index 000000000..e96a85971 --- /dev/null +++ b/setup.py @@ -0,0 +1,11 @@ +from setuptools import Distribution, setup + + +class BinaryDistribution(Distribution): + """Mark wheels containing the pre-built Cython modules as platform-specific.""" + + def has_ext_modules(self) -> bool: + return True + + +setup(distclass=BinaryDistribution) diff --git a/test.sh b/test.sh index d91afb035..f4aae3fb3 100755 --- a/test.sh +++ b/test.sh @@ -9,6 +9,17 @@ source ./setup.sh # *** build *** scons -j8 +# Verify the package is installable and is not mislabeled as platform-independent. +rm -rf dist +uv build --wheel +wheel="$(find dist -maxdepth 1 -name '*.whl' -print -quit)" +if [[ "$wheel" == *-none-any.whl ]]; then + echo "native extension wheel is incorrectly tagged as platform-independent: $wheel" >&2 + exit 1 +fi +uv run --isolated --no-project --with "$wheel" --directory / python -c \ + "import msgq, msgq.visionipc" + # *** lint + test *** lefthook run test From b8924d9f5a57351fcdaee52217a8987bdad2c294 Mon Sep 17 00:00:00 2001 From: Rahul Sharma Date: Fri, 7 Aug 2026 10:58:08 +0530 Subject: [PATCH 2/2] fix isolated wheel test path --- test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.sh b/test.sh index f4aae3fb3..6a040c7ae 100755 --- a/test.sh +++ b/test.sh @@ -12,7 +12,7 @@ scons -j8 # Verify the package is installable and is not mislabeled as platform-independent. rm -rf dist uv build --wheel -wheel="$(find dist -maxdepth 1 -name '*.whl' -print -quit)" +wheel="$(realpath "$(find dist -maxdepth 1 -name '*.whl' -print -quit)")" if [[ "$wheel" == *-none-any.whl ]]; then echo "native extension wheel is incorrectly tagged as platform-independent: $wheel" >&2 exit 1