Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ classifiers = [
]
dependencies = []

[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project.optional-dependencies]
dev = [
"setuptools", # for distutils
Expand Down
11 changes: 11 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -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)
11 changes: 11 additions & 0 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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="$(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
fi
uv run --isolated --no-project --with "$wheel" --directory / python -c \
"import msgq, msgq.visionipc"

# *** lint + test ***
lefthook run test

Expand Down
Loading