You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now we only test our code on Ubuntu, MacOS, Windows.
It covers quite a lot of cases, but surely not of them. For example, we can make some mistakes with sys.platform == "linux". For example, some values might be Ubuntu-specific.
For example, some values might be Ubuntu-specific.
Do you have a specific example in mind? The kernel and installed libraries define much of what's available when Python is compiled, and that to me doesn't seem to have much to do with linux distros. That said, there is at least one known value that is missing on linux, because of a bug in glibc, and it might be present on a musl-based distro: #5360 (comment)
I would also love to add some BSD-based OS
Indeed. It would be nice if there was some OS that doesn't match any of our if sys.platform == "foo" checks. For example,
if sys.platform != "win32" and sys.platform != "darwin":
is different from
if sys.platform == "linux":
but currently our CI doesn't distinguish those. This is especially bad when the platform checks must be repeated in two places, e.g. os/__init__.pyi and posix.pyi.
The benefit from additional OS-es in CI seems small to me (both in terms of how often it'd flag a regression and the end impact on users), so I personally wouldn't spend much energy on this. I'd certainly merge PRs that improve things for other OS-es though / would be curious to see the diff if you've run anything one-off.
One related thing is that flake8-pyi currently only understands a small set of sys.platforms. Probably easy to fix though.
Activity
Akuli commentedon Jan 4, 2022
Do you have a specific example in mind? The kernel and installed libraries define much of what's available when Python is compiled, and that to me doesn't seem to have much to do with linux distros. That said, there is at least one known value that is missing on linux, because of a bug in glibc, and it might be present on a musl-based distro: #5360 (comment)
Indeed. It would be nice if there was some OS that doesn't match any of our
if sys.platform == "foo"checks. For example,is different from
but currently our CI doesn't distinguish those. This is especially bad when the platform checks must be repeated in two places, e.g.
os/__init__.pyiandposix.pyi.hauntsaninja commentedon Jan 5, 2022
The benefit from additional OS-es in CI seems small to me (both in terms of how often it'd flag a regression and the end impact on users), so I personally wouldn't spend much energy on this. I'd certainly merge PRs that improve things for other OS-es though / would be curious to see the diff if you've run anything one-off.
One related thing is that
flake8-pyicurrently only understands a small set of sys.platforms. Probably easy to fix though.JelleZijlstra commentedon Jan 7, 2022
That's intentional to guard against typos and dead code. However, we can easily add more real-life sys.platform values if there's a need.
hauntsaninja commentedon Feb 18, 2022
Closing to keep things tidy, but definitely feel free to fix things one-off / get a concrete sense for if there's any benefit to be had.