prepare_metadata_for_build_wheel yields different SOURCES.txt depending on environment #4950
Replies: 2 comments 3 replies
-
It has been brought to my attention that above error is coming from So this is an issue with I still think it's undesirable for a broken config to be ignored just because it happens to reside in a repo. |
Beta Was this translation helpful? Give feedback.
-
Upstream has:
That leads to the following
It's an easy fix.
That doesn't make a difference in this situation. Both |
Beta Was this translation helpful? Give feedback.
-
I came across some unexpected behavior of
prepare_metadata_for_build_wheel
yielding a differentSOURCES.txt
depending on whether the function is called inside a repository checkout or not.Steps to reproduce:
cd /tmp
git clone https://github.com/AFM-analysis/igor2.git
cd igor2
SETUPTOOLS_SCM_PRETEND_VERSION="0.0.7" python3 -c 'import setuptools.build_meta as sbm; sbm.prepare_metadata_for_build_wheel(".")'
This results in
igor2.egg-info/SOURCES.txt
including everything belowigor2/
. That is all subpackages.Clean up for the next iteration:
git clean -dxf
rm -rf .git/
This results in a situation very similar to installing a release tarball from upstream. Now re-run step 4 from above.
The produced
igor2.egg-info/SOURCES.txt
only contains the toplevel packageigor2
, but none of the subpackages. This is the result of upstream's brokenpyproject.toml
, which has:An error (listing git files failed - pretending there aren't any) is shown when not inside a git repo. That seems to suggest the difference in behavior is intentional.
Can that be turned off somehow? In other words, do users have any control over the git specific behavior?
When using pip to build a wheel from the git checkout, I do get a BIG warning that packages would be ignored due to ambiguous configuration, but not when building the wheel from the extracted tar archive. I think in the latter case it would be rather helpful showing a warning regarding ambiguous configuration and (sub)packages being ignored.
Beta Was this translation helpful? Give feedback.
All reactions