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

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

Merged
merged 6 commits into from
Dec 15, 2023

Conversation

cclauss
Copy link
Contributor

@cclauss cclauss commented Nov 28, 2023

    strategy:
      matrix:
        python:
+         - "3.11"
+         - "3.12"
        include:
+         - os: "ubuntu-latest"
+           python: "pypy-3.10"
+         - os: "macos-latest"
+           python: 3.x

+          - "3.11"
+          - "3.12"
+          - os: "ubuntu-latest"
+            python: "pypy-3.10"
+          - os: "macos-latest"
+            python: 3.x
@cclauss cclauss changed the title Update ci.yaml Test on modern versions of CPython and PyPy Nov 28, 2023
@cclauss cclauss changed the title Test on modern versions of CPython and PyPy Test on modern versions of CPython and PyPy and macOS Nov 28, 2023
@HorlogeSkynet HorlogeSkynet requested a review from a team November 29, 2023 21:56
@HorlogeSkynet HorlogeSkynet added this to the 1.8.1 milestone Nov 29, 2023
HorlogeSkynet
HorlogeSkynet previously approved these changes Nov 29, 2023
Comment on lines 46 to 49
- os: "ubuntu-latest"
python: "pypy-3.10"
- os: "macos-latest"
python: 3.x
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use explicit ubuntu-22.04 and macos-12 here please, the more pinned, the better for CI stability. Can we pin 3.x any more? Is this intended to be 3.13 pre-release?

Copy link
Contributor Author

@cclauss cclauss Nov 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My Mac is running 14.1.1. Why do we want to pin to an OS that is two major versions behind the current macOS?

Python 3.x pins to the latest released version of CPython which will remain 3.12 until October 2024.

I like it when CI highlights when OS upgrades break the tests rather than waiting for users to complain.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @cclauss, thanks for the adjustments!

My Mac is running 14.1.1. Why do we want to pin to an OS that is two major versions behind the current macOS?

Because macos-latest is macos-12 is of today, see https://github.com/actions/runner-images#about . Their macos-13 is in beta and they have no 14 as of today.

I like it when CI highlights when OS upgrades break the tests rather than waiting for users to complain.

That is a great idea in its core but broken CI means that e.g. all new pull request starting before a fix will have no chance on a green CI, and I have seen broken CI that no one fixes for weeks in too many places to ever want to go into the red zone voluntarily. The approach with testing against the latest moving things only really works well when the errors are ignored but notified about. Latest time I checked, GitHub Actions doesn't allow operation like that in practice, happy to be proven wrong about that for today. The best approach I know is pinning evereything hard and let a machine produce auto-update pull requests. What Dependabot and Renovate cannot cover, you can cover yourself e.g. using https://github.com/peter-evans/create-pull-request . That was the long version, I hope that was in your interest.

Python 3.x pins to the latest released version of CPython which will remain 3.12 until October 2024.

Let's make it 3.12 then for CI stability, please.

@cclauss
Copy link
Contributor Author

cclauss commented Nov 30, 2023

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

@nir0s
Copy link
Collaborator

nir0s commented Nov 30, 2023

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 (#177), but, apparently, it wasn't urgent for anyone to actually finish the job. You're more than invited.

.github/workflows/ci.yaml Outdated Show resolved Hide resolved
.github/workflows/ci.yaml Outdated Show resolved Hide resolved
Copy link
Contributor

@hartwork hartwork left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cclauss thanks for the pinning! 🙏

@chenrui333
Copy link

chenrui333 commented Nov 30, 2023

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"
    }
}

@HorlogeSkynet HorlogeSkynet merged commit 6a487e9 into python-distro:master Dec 15, 2023
12 checks passed
@cclauss cclauss deleted the patch-1 branch December 15, 2023 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants