Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple platforms match current OS for a debian docker image #72

Closed
gsemet opened this issue Sep 16, 2024 · 6 comments
Closed

Multiple platforms match current OS for a debian docker image #72

gsemet opened this issue Sep 16, 2024 · 6 comments
Labels
🐛 bug Something isn't working, or a fix is proposed

Comments

@gsemet
Copy link

gsemet commented Sep 16, 2024

Hello

We are using custom made debian linux image on our Python development environemtn (mainly derivating from the official python images on github), but extras-platforms now raises in the current_os:

RuntimeError: Multiple platforms match current OS: [Platform(id='debian', name='Debian', current=True), Platform(id='unknown_linux', name='Unknown Linux', current=True)]

It is a debian, why does it also matches with the unknown_linux ? And even if two platforms are matching, why not matching the first matching? It kind of breaking all our CI now we updated to a package that depends on extras-platforms...

@gsemet
Copy link
Author

gsemet commented Sep 16, 2024

Reproduced with

$ sudo docker run -it python:3.10 bash
# from here, we are inside the docker image
$ pip install extra_platforms
$ python
>>> import extra_platforms
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.10/site-packages/extra_platforms/__init__.py", line 181, in <module>
    CURRENT_OS_ID: str = current_os().id
  File "/usr/local/lib/python3.10/site-packages/extra_platforms/__init__.py", line 168, 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)]
>>> 

@mrevoir
Copy link

mrevoir commented Sep 17, 2024

I am getting this as well on macOS Sequoia with multiple containers based on Bitnami/Python

Python 3.9.18 (main, Jan 28 2024, 21:40:32) 
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from extra_platforms import UNIX, current_os
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/bitnami/python/lib/python3.9/site-packages/extra_platforms/__init__.py", line 181, in <module>
    CURRENT_OS_ID: str = current_os().id
  File "/opt/bitnami/python/lib/python3.9/site-packages/extra_platforms/__init__.py", line 168, 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)]

@kdeldycke
Copy link
Owner

Thank you all for the feedback! You're right, my heuristics to detect linux distributions are too lax and conflicting. I'll fix that right away.

@kdeldycke
Copy link
Owner

Issue has been fixed upstream. Give me a bit of more time to cut a release.

@kdeldycke
Copy link
Owner

extra-platforms 1.3.1 is now available on PyPi: https://pypi.org/project/extra-platforms

kdeldycke added a commit to kdeldycke/click-extra that referenced this issue Sep 18, 2024
@mrevoir
Copy link

mrevoir commented Sep 18, 2024

extra-platforms 1.3.1 is now available on PyPi: https://pypi.org/project/extra-platforms

Thanks for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working, or a fix is proposed
Projects
None yet
Development

No branches or pull requests

3 participants