pip: pip wheel . does not follow symlinks whereas python setup.py bdist_wheel does
When the package source code contains symlinks, python setup.py bdist_wheel
follows them and store their content in the resulting wheel.
pip wheel .
ignores them.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 7
- Comments: 29 (27 by maintainers)
I now think this issue or variants of it arise in any situation where
I found three variants:
.git/
is in a parent directory not copied to the temp dir by pipSince pip copies the subtree to a temporary location before building, when running
pip install .
orpip wheel .
resources that reside out of the subtree are not available for building.I think this happens both for pep517 and legacy builds.
Note that when running
pip install git+http://g.c/repo/project#egg=project&subdirectory=subdir
it works fine because the whole project is available (I think no additional copy takes place in that case).So while it could be possible to fix this particular issue (case 1.) with some strategy to preserve symlinks when copying to the temporary directory, this would not solve 2. nor 3.
I’m not sure if pep517 build isolation mandates working on a temporary copy of the source tree.
Maybe a possible approach could be to have a way for build backends to declare that they are safe for in-place builds (in an isolated build environment, but in the same source tree). Build backend would then have a way to promise to front ends they will not modify the source tree. And pip could use that information to decide to build in place without copying to a temporary directory.
Do you think it’s a track worth investigating further?
@RonnyPfannschmidt I’m not sure that’s true, since we’re going to be executing a
setup.py
anyways after we copy it, I doubt there’s anything you can do with symlinks you couldn’t just do in the Python file itself.