Skip to content

Make the package pip-installable - #17

Open
louislelay wants to merge 3 commits into
XR-Robotics:mainfrom
louislelay:pypi-packaging
Open

louislelay wants to merge 3 commits into
XR-Robotics:mainfrom
louislelay:pypi-packaging

Conversation

@louislelay

Copy link
Copy Markdown

Goal

Enable pip install xrobotoolkit-sdk / uv add xrobotoolkit-sdk from PyPI, and reduce the from-source install to git clone + uv sync, meaning no more manual SDK download, build scripts, or copying headers around.

How

The key enabler: upstream XRoboToolkit-PC-Service already ships prebuilt PXREARobotSDK binaries for every supported target. This PR vendors them (Linux x86_64/aarch64, Windows amd64, commit 85bac4d, see vendor/README.md) so the build is fully self-contained, then modernizes the packaging around that:

  • setup.py + the three platform setup scripts are replaced by pyproject.toml with scikit-build-core; uv-first workflow (uv sync, uv build, uv.lock, Python 3.13 pinned, requires-python >= 3.10).
  • The extension becomes xrobotoolkit_sdk._core inside a regular package that bundles the vendored lib next to it (rpath $ORIGIN on Linux, os.add_dll_directory on Windows). Public API is unchanged.
  • New Wheels workflow: cibuildwheel builds sdist + wheels for cp310–cp314 (manylinux_2_34 x86_64/aarch64 + Windows), and publishes to PyPI via trusted publishing on v* tags.

Verification

CI on this PR builds all wheels and smoke-tests import xrobotoolkit_sdk on each platform (this exercises the bundled-library loading). Artifacts are attached to the workflow run for manual testing.

louislelay and others added 3 commits September 14, 2026 19:23
…cikit-build-core

- Vendor prebuilt PXREARobotSDK binaries (linux x86_64/aarch64, windows amd64)
  and headers from upstream commit 85bac4d under vendor/
- Replace setup.py + setup scripts with pyproject.toml (scikit-build-core)
- Repackage as xrobotoolkit_sdk package with _core extension, rpath $ORIGIN
  on Linux and os.add_dll_directory on Windows
- Add cibuildwheel workflow (manylinux_2_34, cp310+) with PyPI trusted publishing
- Update README and CLAUDE.md build instructions

Co-authored-by: Cursor <cursoragent@cursor.com>
…indows link)

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@louislelay

Copy link
Copy Markdown
Author

cc @zhigenzhao @SherwinDengxiong for visibility

@luffy-yu

Copy link
Copy Markdown

@louislelay Thank you for this PR!

I tested on Windows 11.

uv sync and uv build can generate dist\xrobotoolkit_sdk-1.1.0-cp313-cp313-win_amd64.whl.

uv run python works, but pip install failed because of the Python version difference.

Successfully built dist\xrobotoolkit_sdk-1.1.0.tar.gz
Successfully built dist\xrobotoolkit_sdk-1.1.0-cp313-cp313-win_amd64.whl
PS D:\Work\Github\XRoboToolkit-PC-Service-Pybind> python
Python 3.11.0 (main, Oct 24 2022, 18:26:48) [MSC v.1933 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import xrobotoolkit
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'xrobotoolkit'
>>> import xrobotoolkit_sdk
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'xrobotoolkit_sdk'
>>> exit()
PS D:\Work\Github\XRoboToolkit-PC-Service-Pybind> uv run python
Python 3.13.15 (main, Aug 14 2026, 15:36:10) [MSC v.1944 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import xrobotoolkit_sdk
>>> exit()
PS D:\Work\Github\XRoboToolkit-PC-Service-Pybind> pip install .\dist\xrobotoolkit_sdk-1.1.0-cp313-cp313-win_amd64.whl
ERROR: xrobotoolkit_sdk-1.1.0-cp313-cp313-win_amd64.whl is not a supported wheel on this platform.

@luffy-yu

Copy link
Copy Markdown

It also happened on Linux.

It seems uv build relies on the Python version within uv, so the wheel doesn't work with another version of Python.

Then is it possible to make uv build output a manylinux wheel?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants