-
Notifications
You must be signed in to change notification settings - Fork 3
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
Fix python version problems #214
Conversation
.github/workflows/wheels.yml
Outdated
@@ -13,7 +11,7 @@ jobs: | |||
- uses: actions/checkout@v3 | |||
- uses: actions/setup-python@v4 | |||
with: | |||
python-version: '3.10' | |||
python-version: ['3.7', '3.8', '3.9', '3.11', 'pypy3.7', 'pypy3.8', 'pypy3.9', '3.10'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be irrelevant, since the wheel is built in any case inside a manylinux
container.
Not sure how to implement it with sed
...
I know something algorithmic is more convenient (even with some changes to the base, sed
would keep working), but if it is too complex I'd rather go for a patch, or just commit the final result manually edited.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
About the irrelevancy I'm not so sure anymore, it seems setup-python
may also have an effect there: https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#using-setup-python-with-a-self-hosted-runner. We should figure out the effect and do it properly as you said.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A self-hosted runner is not a container, but a different machine you provide on your own to run the workflow, instead of using those of GitHub (i.e. Azure...).
Instead, maturin-action
is running a container in a GitHub's virtual machine, that is relevant for the host system (we need a Linux machine to run a Linux container, otherwise we would need a Linux virtual machine inside the virtual machine), but it is not relevant Python-wise, since the manylinux
container comes pre-built with its versions of Python.
This is true only for Linux, while for Windows and MacOS the setup-python
is a crucial step.
.github/workflows/wheels.yml
Outdated
#release: | ||
# name: Release | ||
# runs-on: ubuntu-latest | ||
# if: "startsWith(github.ref, 'refs/tags/')" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is only running on releases, you could keep this uncommented (just to reduce the diff)
.github/workflows/wheels.yml
Outdated
on: | ||
release: | ||
types: [published] | ||
on: push |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can also add an event, without removing the previous one>
on: push | |
on: | |
push: | |
release: | |
types: [published] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's going in the right direction; I think I want to run every job except release
in wheels.yml
whenever I want to test them (in branches like this one).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also what Stefano C is doing in quantum repos (even if they are just pure Python... here I believe it's more relevant).
You can filter the jobs and individual steps with if:
key, as you are doing, and the condition can contain an expression, that can depend on variables in contexts (thus including events and outputs of previous steps).
https://docs.github.com/en/actions/learn-github-actions/expressions
https://docs.github.com/en/actions/learn-github-actions/contexts
https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idif
https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsif
It seems to work, except that on Windows no PyPy (3.7, 3.8, 3.9) wheels are created. |
That is not a problem :) |
I still don't see MacOS wheels for CPython 3.7, 3.8, and 3.9 in https://github.com/NNPDF/pineappl/suites/11369716006/artifacts/584873397 |
You're right: instead the corresponding PyPy wheels are created (and also found) twice. See this line from the action:
Note how it finds PyPy (?) 3.7
Both claim to have
|
I agree, but what worries me is that I don't understand what's going on here. They are installed, but it seems maturin doesn't find them:
|
Then there are two main options:
This I believe to be normal, and most likely the first is a link to the second, in such a way that PyPy can work both side-by-side and as a drop-in replacement of CPython. |
Is this OK? Because the wheel is twice created for PyPy, can CPython work with it? |
No, definitely not. The compiled wheel needs ABI compatibility with the interpreter. It might be that on MacOS, for whatever reason, PyPy is actually the Since for PyPy Linux is definitely far more than enough, maybe just try to remove it from all the lists of |
@cschwan in https://github.com/NNPDF/pineappl/actions/runs/4344435880 we actually obtained all the wheels we wanted:
Moreover, the workflow is now running by default on Should we agree on the current result, or do we have still some desiderata left behind? |
Curious fact: Windows has the smallest wheels, while MacOS the biggest ones
The size of the wheel does not depend on the Python version or the interpreter (wheels for Linux-PyPy are the same size of Linux-CPython). This makes me believe that they are actually very similar, and only the platform makes an actual significant difference... |
As far as it concerns me, that's perfect! Go ahead and merge it. |
These numbers make sense, because for MacOS the universal wheels are basically two wheels in one, one for x86_64 and the other for aarch64. |
Here we'll fix the problems discovered in this comment: #211 (comment).