Replies: 1 comment 5 replies
-
I'm not getting the issue with 1., actually. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I would like to do a proper study of what happens in several situations. Let's say I have a package that depends on another package to build, called "wheelless", maybe picking up headers or something, and that other package does not have a wheel. If I type
pip wheel .
, pip will build all wheels required, including the wheel I don't have control over, and put it in the "wheelhouse". That's what it needs for installing, after all, and that's what it's for, not really for package authors building a wheel. To avoid this, we add--no-deps
, even though that breaks all usages ofsetup_requires
. So, the question is, what happens in the following situations:install_requires="wheelless"
, but nosetup_requires
.pip install .
is broken, since it builds before installing. You have to manually installwheelless
before building or installing.No
install_requires
,setup_requires="wheelless"
. This downloads the package but doesn't install it anywhere, making it completely useless.install_requires="wheelless"
,setup_requires="wheelless"
. Nowpip install .
works.pip wheel .
works too, of course, since it's part of an install, but it puts the"wheelless"
wheel into the wheelhouse.pip wheel . --no-deps
does not work, since it disables this mechanism, socibuildwheel
fails, and this is the origin (and only place it is useful) of the suggestionCIBW_BEFORE_BUILD: pip install .
, which builds the package twice, doubling your CI resources. (unless the wheels are reused from the old cache?). Note that this is a very tacky workaround on setuptools's part, it has to run setup.py twice, it can't add anything and also use it in setup.py itself, it can't control setuptools' version, etc., so it was deprecated and replaced withpyproject.toml
.pyproject.toml
containswheelless
. This is actually the only solution that does not installwheelless
in the target environment, but only has it present in the isolated build environment. I'm not completely sure this does not also end up with wheelless in the output folder, but in my projects I seem to just upload the wheel dir with no problems, so I am almost sure it does not. This "just works" for cibuildwheel, since it's not disabled (--no-build-isolation
/PIP_NO_BUILD_ISOLATION
).It would be nice to improve the experience for 3); one option would be to use pypa-build, which should not put build requirements into the output dir, I think.
Another option would be to manually filter, but I think that's too hard - a package can specify more than one output, which would be valid, names are not guarantied, etc.
What about adding
--only-binary=:all:
instead, perhaps? Instead of not working, this will just not work if it has to build an unexpected wheel, and users will know what package they should pre-install when it fails. For the most common dependencies (universal wheels), there's no reason to completely disable them (pip is smart enough to only put new wheels in the wheelhouse, not ones it downloaded). I haven't tried this, though, it would be quite silly if it expected the current project to have a wheel!Beta Was this translation helpful? Give feedback.
All reactions