-
Notifications
You must be signed in to change notification settings - Fork 234
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
feat: add nox runner #661
feat: add nox runner #661
Conversation
Looks really nice! So Buuut, hmm, just thinking about dependencies - the downside of using nox like this is that we rely on GHA having the right versions of Python available. This might not be the case in a beta situation, where we want to generate a 3.10 constraints file but GHA hasn't added it yet? The nice thing about relying on the manylinux image was that the manylinux image was already a dependency, so we weren't adding any more Python version constraints. Could we get into a situation where we want to add a beta version of Python but we can't because GHA doesn't support it yet? |
GHA gets new versions of Python about 24 hours after they get released, including Alpha versions (at least, they become installable via setup-python@v2, which is all you need - the nox action is simply a front for running setup-python multiple times). But there's really no special requirement here, all nox needs is the versions of Python somewhere - you could even use the manylinux docker images as long as you installed nox before running nox (and possibly setup the paths a bit, since it might not be able to find the manylinux locations natively?). Actually, here's a quick proof of concept: $ docker run --rm -v $PWD:/src -it quay.io/pypa/manylinux_2_24_x86_64
# cd /src
# /opt/_internal/tools/bin/pip install nox
# ln -s /opt/python/cp36-cp36m/bin/python3.6 ../usr/local/bin/.
# ln -s /opt/python/cp37-cp37m/bin/python3.7 ../usr/local/bin/.
# ln -s /opt/python/cp38-cp38/bin/python3.8 ../usr/local/bin/.
# ln -s /opt/python/cp39-cp39/bin/python3.9 ../usr/local/bin/.
# /opt/_internal/tools/bin/nox -s update_constraints @mayeut why are the altinstall names not available in manylinux |
83b2425
to
226d3ca
Compare
I don't have the full history. Maybe the reason you mention is one factor, maybe no one had the need or asked for it. Now that python 2 is gone I'd gladly accept a PR adding those symlinks (& maybe pip3.? ones also). I'd even go for a python & python3 symlink to "the mainstream" python version (i.e. probably 3.7 today). |
Okay, great, noted!
I think I'd want to avoid this, as it could be easy to accentually build with the "mainstream" python when you intended to build with each version of Python, say in a loop. But the |
Well, given we can't remove the system python which is a dependency of other needed packages, it's already a mess:
One can argue that
The applications/tools are in fact not directly accessible, there's just a symlink to auditwheel in We can take this over to a manylinux issue if you want to revisit what's being done there. |
That's good to know. Yeah, I'm encouraged by the simplicity of your proof-of-concept - that would be a nice escape hatch if we ever had issues with GHA's Pythons, or wanted to run this locally for some reason. Even better if nox happened to work natively in a manylinux image through those symlinks you mention! |
Assuming you also saw in the docs, there is a recommended docker image for nox too: docker run --rm -it -v $PWD:/src thekevjames/nox nox -f src/noxfile.py -s update_constraints That can be run in GHA too, like: test:
runs-on: ubuntu-latest
container: thekevjames/nox:2020.12.31
steps:
...
- run: nox (Readme is a little hard to find from the docker readme, and uses outdated syntax for the example) |
@@ -114,3 +114,6 @@ site/ | |||
|
|||
# Virtual environments | |||
venv* | |||
|
|||
# PyCharm |
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.
I wonder how I didn't come across this one before. I probably added a global rule for this at some point...
I don't know about nox (maybe too specific a tool?), but having pipx inside manylinux seems like a nice idea! Then we could do |
pipx sort of removes the requirement to have any other tools due to |
226d3ca
to
52d67fe
Compare
More advanced users can run the update scripts. `update_pins` should work directly, but `update_constraints` needs all versions of Python installed. If you don't want to do that locally, a fast way to run it to use docker to run nox: | ||
|
||
```console | ||
docker run --rm -it -v $PWD:/src quay.io/pypa/manylinux2010_x86_64:latest pipx run nox -f src/noxfile.py -s update_constraints |
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.
FYI this works now
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 really nice. 👏
52d67fe
to
ae7f4a3
Compare
I've moved |
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.
Looks good to me! Up to you if you'd rather merge this or #675 first!
Happy to get this in as soon as possible, because I like using it. :) |
Closes #646. First pass at providing a Nox interface to common tasks.