Fix macOS compatibility in duckiematrix_utils.py #531
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
The
duckiematrix_utils.pymodule had an inconsistency in OS platform detection that prevented the duckiematrix application from working correctly on macOS.The issue was in the
get_path_to_binary()function, which usedplatform.system()directly (returning"Darwin"on macOS), while other functions likeget_os_family(),remote_zip_obj(), andis_version_released()usedget_os_family()(returning"macosx"on macOS).This inconsistency caused:
duckiematrix-{version}-macosx.zip"Darwin"instead of"macosx"Solution
Changed
get_path_to_binary()to useget_os_family()instead ofplatform.system()directly, ensuring consistent platform identification across all functions in the module:This ensures that the OS family identifier used for remote ZIP file paths (
"macosx") matches the identifier used for binary path construction, enabling proper installation and execution on macOS.Testing
Verified that the fix ensures consistency across all platforms:
"linux"consistently"macosx"consistently"windows"consistentlyApplied Black code formatting as per repository standards.
Related Files
Note that
duckietown_viewer_utils.pyalready implements this pattern correctly (using"macos"consistently), and no changes were needed there.Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.