Skip to content

Commit

Permalink
Fix detection heuristics for Linux, closes #72
Browse files Browse the repository at this point in the history
  • Loading branch information
kdeldycke committed Sep 18, 2024
1 parent b4326c0 commit 308ec75
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
> [!IMPORTANT]
> This version is not released yet and is under active development.
- Fix conflicting detection heuristics for Linux distributions. Closes #72.

## [1.3.0 (2024-09-11)](https://github.com/kdeldycke/extra-platforms/compare/v1.2.1...v1.3.0)

- Add detection of all versions of macOS and Windows. Closes #55.
Expand Down
11 changes: 8 additions & 3 deletions extra_platforms/detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

from __future__ import annotations

import logging
import platform
import sys
from os import environ
Expand Down Expand Up @@ -284,9 +285,13 @@ def is_unknown_linux() -> bool:
Excludes WSL1 and WSL2 from this check to
`avoid false positives <https://github.com/kdeldycke/meta-package-manager/issues/944>`_.
"""
return sys.platform.startswith("linux") and not (
is_ubuntu() or is_wsl1() or is_wsl2()
)
unknown_linux = sys.platform.startswith("linux") and not (is_wsl1() or is_wsl2())
if unknown_linux:
logging.warning(
f"Unknow Linux detected: {distro.info()!r}. You can report this warning to"
" the extra-platforms project to improve detection heuristics."
)
return unknown_linux


@cache
Expand Down

0 comments on commit 308ec75

Please sign in to comment.