-
Notifications
You must be signed in to change notification settings - Fork 239
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
User-specified arguments for pip wheel #268
Comments
You could be right on this, it's something that comes up relatively frequently. Previously we've discussed the possibility of allowing the user to customise the whole pip wheel command, but it was dismissed as too cumbersome, too much internal logic making its way into the config files. A previous discussion on this #120 also considered it, but in the end pyproject.toml had the features required. Specifically, the The other thing I can recommend is to try setting the Our examples, which install deps in CIBW_BEFORE_BUILD, don't assume the use of pyproject.toml. Build isolation is disabled if a pyproject.toml isn't found. Although maybe pyproject.toml use is going to increase - is that the recommended way to build a Cython project these days? |
Thanks for the helpful response!
I found the state of documentation concerning setuptools, Cython and the PEPs unsatisfactory. Many recommendations are still aimed at old tooling and the official documentation does not inform well about the role of pyproject.toml. The problem with Cython is that two kinds of procedures are required for the same project:
So that is a scenario where it is important to pass further options to |
Thank you for this. I think I see why
On a side note, you've clearly thought a lot about this! Once you get it figured out, would you be interested in writing a guide that we could host in our docs of a 'recommended' modern way to build Cython wheels? |
I'm the first to admit this is somewhat esoteric 😄
It's possible, but I think it's less clean: PEP 517 defines a backend agnostic way of passing configuration on to the backend (c.f. "Config Settings"). This is implemented by In addition, I want to make
I was planning to write a blog post anyway, I'd love to contribute back to the documentation :) |
It would be good if we can fully support this build isolation, though? I actually still haven't figured this out the difference with the old way of doing things, but Do |
That works, good catch! |
However, the pip wheel frontend for PEP 517 does not support passing configuration to the PEP 517 backend yet pypa/pip#5771 :( Until config passing is supported, this issue is essentially blocked. The general design of the integration with cibuildwheel could already be discussed. |
Ah! That's a bummer. However I like the idea of a cibuildwheel option like That would allow arbitrary config of a build while cibuildwheel maintains control over how But I guess that would have to wait for that feature to be implemented in pip. All that said, if you're still interested in doing a Cython demo project/docs page using one of the workarounds above, I'm sure it would be of great value to Cython users out there :) |
Config options were added in cibuildwheel 2.10! :) |
I would like to see a way to specify additional arguments to
pip wheel
.pip wheel acts as the build frontend here and the only "official" way to pass on arguments to the backend, e.g. a setuptools powered setup.py, is through the
--build-option
and--global-option
flags.More importantly, pip wheel builds the wheel in an isolated environment as suggested in PEP 517 ("Recommendations for build frontends"). In order to have any custom (i.e. not specified in pyproject.toml) build-time dependencies the
--no-build-isolation
argument of pip wheel has to be used.I don't understand how the
CIBW_BEFORE_BUILD
can even be used to install build requirements as suggested in the documentation. pip wheel will creates a new virtualenv where the installed packages should not be available. Perhaps somebody can clarify?(I'm currently looking into
cibuildwheel
in order to prepare wheels for a Cython-based package of mine. It looks like a great way to save boilerplate build scripts!)EDIT: Fixed paragraph related to build isolation; Added second pip wheel option flag.
The text was updated successfully, but these errors were encountered: