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

Using tox-wheel as a backdoor cibuildwheel #19

Open
dHannasch opened this issue Mar 21, 2022 · 0 comments · May be fixed by #20
Open

Using tox-wheel as a backdoor cibuildwheel #19

dHannasch opened this issue Mar 21, 2022 · 0 comments · May be fixed by #20

Comments

@dHannasch
Copy link

dHannasch commented Mar 21, 2022

I hope to make a really strange-looking pull request soon, so I want to prepare the field first.

As you know, cibuildwheel uses Docker. In particular, cibuildwheel running inside a Docker container requires dind. This makes cibuildwheel impossible to run without privileged containers.

That's when I started thinking about the possibilities in tox-wheel.

The list of Python versions we build wheels for should obviously always be the same as the list of Python versions we run tests for. We're already storing that list in tox. So why not make that the single source of truth --- why not use tox to build the wheels? tox-wheel is already building the wheels anyway!

And with some minor tweaks to tox-pyenv-install (already made), we can install Python versions on-the-fly if we're missing any, so we don't need cibuildwheel for that either.

This works (for a certain value of "works"), as seen in e.g. https://gitlab.com/library-cookiecutters/python-nameless/-/jobs/2226842902.

creating '/builds/library-cookiecutters/python-nameless/.tox/dist/nameless-0.1.dev50-cp39-cp39-linux_x86_64.whl' and adding 'build/bdist.linux-x86_64/wheel' to it
creating '.tox/dist/nameless-0.1.dev50-cp310-cp310-linux_x86_64.whl' and adding 'build/bdist.linux-x86_64/wheel' to it

(I have no idea why it sometimes prints an absolute path and sometimes prints a relative path, but I don't think it's important.)

So this is all working and building wheels for every Python version we want. The problem, of course, is that tox cleans out the distdir before each env. So at the end of the process, there is always one wheel in the distdir...but only one, whichever wheel was built last. (See e.g. https://gitlab.com/library-cookiecutters/python-nameless/-/jobs/2226871591/artifacts/browse/dist/)

So I want to make it possible to save all the wheels and collect them at the end, analogous to how https://github.com/ionelmc/cookiecutter-pylibrary/blob/master/%7B%7Bcookiecutter.repo_name%7D%7D/tox.ini#L215 reports on code coverage for tests run by other toxenvs. (I'm not yet sure how best to do that, though. Well, if nothing else, tacking on a command to https://github.com/ionelmc/tox-wheel/blob/master/src/tox_wheel/plugin.py#L158 copying the wheel elsewhere would probably work.)

@dHannasch dHannasch linked a pull request Mar 21, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant