Skip to content
Closed
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
15 changes: 15 additions & 0 deletions robotpy_installer/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down Expand Up @@ -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,
Expand All @@ -529,6 +535,15 @@ 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
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,
Expand Down
Loading