Skip to content

Add more OS to the test? #6808

Closed
Closed

Description

@sobolevn

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.

GitHub Actions does not support any other OSes natively: https://github.com/proxy/docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#jobsjob_idruns-on

But, we can add several docker-container tests as we do in https://github.com/sobolevn/git-secret/blob/master/.github/workflows/test.yml#L26-L32

I think that we can add Alpine (since it is a linux, but a completely different one).

I would also love to add some BSD-based OS, but that's another topic. 🤔 (because docker is kinda broken for BSD-*)

Refs #6807

Activity

  1. Akuli commented on Jan 4, 2022

    @Akuli
    Collaborator

    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.

  2. hauntsaninja commented on Jan 5, 2022

    @hauntsaninja
    Collaborator

    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.

  3. JelleZijlstra commented on Jan 7, 2022

    @JelleZijlstra
    Member

    One related thing is that flake8-pyi currently only understands a small set of sys.platforms.

    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.

  4. hauntsaninja commented on Feb 18, 2022

    @hauntsaninja
    Collaborator

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions