Skip to content

Conversation

Copy link

Copilot AI commented Oct 3, 2025

Problem

The duckiematrix_utils.py module 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 used platform.system() directly (returning "Darwin" on macOS), while other functions like get_os_family(), remote_zip_obj(), and is_version_released() used get_os_family() (returning "macosx" on macOS).

This inconsistency caused:

  • Remote version checking to look for files like: duckiematrix-{version}-macosx.zip
  • Binary path construction to check for: "Darwin" instead of "macosx"
  • Installation and version matching to fail on macOS systems

Solution

Changed get_path_to_binary() to use get_os_family() instead of platform.system() directly, ensuring consistent platform identification across all functions in the module:

# Before
system: str = platform.system()  # Returns "Darwin" on macOS
if system == "Darwin":
    ext = "app"

# After  
system: str = get_os_family()  # Returns "macosx" on macOS
if system == "macosx":
    ext = "app"

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: Uses "linux" consistently
  • macOS: Uses "macosx" consistently
  • Windows: Uses "windows" consistently

Applied Black code formatting as per repository standards.

Related Files

Note that duckietown_viewer_utils.py already implements this pattern correctly (using "macos" consistently), and no changes were needed there.

Original prompt

Analyze this repository to determine if there are changes that would need to be performed to make the python package compatible with macOS.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Changed get_path_to_binary() to use get_os_family() instead of platform.system() directly. This ensures consistency with remote_zip_obj() and is_version_released() which use get_os_family() returning "macosx" for Darwin.

Before: platform.system() returned "Darwin" causing mismatch with "macosx" used in remote paths
After: get_os_family() returns "macosx" consistently across all functions

Co-authored-by: Tuxliri <[email protected]>
Copilot AI changed the title [WIP] Analyze this repository to determine if there are changes that would need to be performed to make the python package compatible with macOS. Fix macOS compatibility in duckiematrix_utils.py Oct 3, 2025
Copilot AI requested a review from Tuxliri October 3, 2025 12:25
Copilot finished work on behalf of Tuxliri October 3, 2025 12:25
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