From 76ad78b371d96b5092de1437b6f43381e28de74a Mon Sep 17 00:00:00 2001 From: Kellen Watt Date: Sun, 23 Nov 2025 18:06:41 -0600 Subject: [PATCH 1/3] Add support for extension modules from PyPI This adds support for installing binary wheels that are not named using the "linux_roborio" platform tag, since this tag is not allowed on PyPI, but "linux_armv7l" (the platform tag for the RoboRIO) is. The changes here also easily allow for adding or changing platforms, if either of these should ever become relevant. --- robotpy_installer/installer.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/robotpy_installer/installer.py b/robotpy_installer/installer.py index bbdde70..4c76fb8 100755 --- a/robotpy_installer/installer.py +++ b/robotpy_installer/installer.py @@ -36,6 +36,9 @@ ] _ROBOTPY_PYTHON_PLATFORM = "linux_roborio" +_ROBOTPY_PYTHON_ADDITIONAL_PLATFORMS = [ + "linux_armv7l", +] _ROBOTPY_PYTHON_VERSION_TUPLE = (3, 13) _ROBOTPY_PYTHON_VERSION_NUM = "".join(map(str, _ROBOTPY_PYTHON_VERSION_TUPLE)) _ROBOTPY_PYTHON_VERSION = f"python{_ROBOTPY_PYTHON_VERSION_NUM}" @@ -510,6 +513,9 @@ def pip_download( str(self.pip_cache), ] + for platform in _ROBOTPY_PYTHON_ADDITIONAL_PLATFORMS: + pip_args.extend(["--platform", platform]) + self._extend_pip_args( pip_args, None, @@ -529,6 +535,14 @@ def pip_download( if retval != 0: raise InstallerException("pip download failed") + for platform in _ROBOTPY_PYTHON_ADDITIONAL_PLATFORMS: + for wheel in self.pip_cache.glob(f"*-{platform}.whl"): + file_name = wheel.name + new_name = file_name.replace(platform, _ROBOTPY_PYTHON_PLATFORM) + target = self.pip_cache / new_name + wheel.rename(target) + + def pip_install( self, force_reinstall: bool, From fbb21ceefd8d2213d996fb7ed0dea0f8b8ab7b9e Mon Sep 17 00:00:00 2001 From: Kellen Watt Date: Sun, 23 Nov 2025 18:12:34 -0600 Subject: [PATCH 2/3] Add clarifying comment for renaming action --- robotpy_installer/installer.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/robotpy_installer/installer.py b/robotpy_installer/installer.py index 4c76fb8..111f325 100755 --- a/robotpy_installer/installer.py +++ b/robotpy_installer/installer.py @@ -535,6 +535,8 @@ def pip_download( if retval != 0: raise InstallerException("pip download failed") + # Changes the name of the wheel to support the more generic "linux_roborio" platform + # This is a dubious hack, but should generally work in practice for platform in _ROBOTPY_PYTHON_ADDITIONAL_PLATFORMS: for wheel in self.pip_cache.glob(f"*-{platform}.whl"): file_name = wheel.name From f74b7f905b2439b3f66f5aa3e41f166557dea13f Mon Sep 17 00:00:00 2001 From: Kellen Watt Date: Tue, 25 Nov 2025 12:37:23 -0600 Subject: [PATCH 3/3] Allow Black to reformat the addition --- robotpy_installer/installer.py | 1 - 1 file changed, 1 deletion(-) diff --git a/robotpy_installer/installer.py b/robotpy_installer/installer.py index 111f325..f51c7b6 100755 --- a/robotpy_installer/installer.py +++ b/robotpy_installer/installer.py @@ -544,7 +544,6 @@ def pip_download( target = self.pip_cache / new_name wheel.rename(target) - def pip_install( self, force_reinstall: bool,