python-distro / distro

A much more elaborate replacement for removed Python's `platform.linux_distribution()` method
https://distro.readthedocs.io/
Apache License 2.0
265 stars 66 forks source link

Test on modern versions of CPython and PyPy and macOS #362

Closed cclauss closed 10 months ago

cclauss commented 11 months ago
    strategy:
      matrix:
        python:
+         - "3.11"
+         - "3.12"
        include:
+         - os: "ubuntu-latest"
+           python: "pypy-3.10"
+         - os: "macos-latest"
+           python: 3.x
cclauss commented 11 months ago

Oh... Now I see that all pytests except one are skipped on macOS and Windows...

============================= test session starts ==============================
platform darwin -- Python 3.12.0, pytest-7.4.3, pluggy-1.3.0
cachedir: .tox/py/.pytest_cache
rootdir: /Users/runner/work/distro/distro
plugins: cov-4.1.0
collected 234 items

tests/test_distro.py .ssssssssssssssssssssssssssssssssssssssssssssssssss [ 21%]
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 52%]
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 83%]
sssssssssssssssssssssssssssssssssssssss                                  [100%]

---------- coverage: platform darwin, python 3.12.0-final-0 ----------

Are macOS and Windows supported or not? https://github.com/Homebrew/homebrew-core/pull/155740 @chenrui333

nir0s commented 11 months ago

Oh... Now I see that all pytests except one are skipped on macOS and Windows...

============================= test session starts ==============================
platform darwin -- Python 3.12.0, pytest-7.4.3, pluggy-1.3.0
cachedir: .tox/py/.pytest_cache
rootdir: /Users/runner/work/distro/distro
plugins: cov-4.1.0
collected 234 items

tests/test_distro.py .ssssssssssssssssssssssssssssssssssssssssssssssssss [ 21%]
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 52%]
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 83%]
sssssssssssssssssssssssssssssssssssssss                                  [100%]

---------- coverage: platform darwin, python 3.12.0-final-0 ----------

Are macOS and Windows supported or not? Homebrew/homebrew-core#155740 @chenrui333

Windows and OSx aren't supported in the sense that we don't identify them. It doesn't mean that distro can't run on them, we just won't identify their distributions.

There's been an open issue for this for a very long time now (https://github.com/python-distro/distro/issues/177), but, apparently, it wasn't urgent for anyone to actually finish the job. You're more than invited.

chenrui333 commented 11 months ago

Windows and OSx aren't supported in the sense that we don't identify them. It doesn't mean that distro can't run on them, we just won't identify their distributions.

yeah, that is what I saw in my test as well.

this is the running result on ventura arm machine.

$ distro --json
{
    "codename": "",
    "id": "darwin",
    "like": "",
    "version": "22.6.0",
    "version_parts": {
        "build_number": "0",
        "major": "22",
        "minor": "6"
    }
}