Skip to content

Latest release depends on buggy extra-platforms which fails on Proxmox #1094

Closed
@andreby

Description

@andreby

I get this error when click_extra tries to import extra_platforms.
extra_platfoms in turn depends on the distro package, so I'm not sure where to open this bug.

It's unfortunate however, since all click_extra really wants from extra_platforms is is_windows() . It seems excessive to fail completely, since it's clear that at least we're not on Windows :)

Traceback (most recent call last):                                                                                                                                                                          
  File "/usr/local/bin/foo", line 5, in <module>                                                                                                                                                 
    from foo import cli                                                                                                                                                                          
  File "/opt/foo/foo.py", line 40, in <module>
    import click_extra as click
  File "/opt/pipx/venvs/foo/lib/python3.11/site-packages/click_extra/__init__.py", line 65, in <module>
    from .commands import (  # noqa: E402
  File "/opt/pipx/venvs/foo/lib/python3.11/site-packages/click_extra/commands.py", line 32, in <module>
    from .config import ConfigOption
  File "/opt/pipx/venvs/foo/lib/python3.11/site-packages/click_extra/config.py", line 42, in <module>
    from extra_platforms import is_windows
  File "/opt/pipx/venvs/foo/lib/python3.11/site-packages/extra_platforms/__init__.py", line 199, in <module>
    CURRENT_OS_ID: str = current_os().id
                         ^^^^^^^^^^^^
  File "/opt/pipx/venvs/foo/lib/python3.11/site-packages/extra_platforms/__init__.py", line 186, in current_os
    raise RuntimeError(msg)
RuntimeError: Multiple platforms match current OS: [Platform(id='debian', name='Debian', current=True), Platform(id='unknown_linux', name='Unknown Linux', current=True)]

The host looks like this

$ uname -a
Linux foobar 6.8.12-2-pve #1 SMP PREEMPT_DYNAMIC PMX 6.8.12-2 (2024-09-05T10:03Z) x86_64 GNU/Linux
$ pveversion
pve-manager/8.2.7/3e0176e6bb2ade3b (running kernel: 6.8.12-2-pve)

A simple fix would be to change:
from extra_platforms import is_windows
in to
from extra_platforms.detection import is_windows

I think that would avoid triggering the bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐛 bugSomething isn't working, or a fix is proposed📦 dependenciesUpdate of dependencies

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions