Closed jaraco closed 9 months ago
I've replicated the issue in a Linux Docker container as well, so the issue isn't peculiar to my environment.
Curiously, even though I'm seeing these errors when running builds, I'm finding that files are being included that would seem to depend on git metadata, such as Lorem ipsum.txt in jaraco.text.
Oh. I think I see what's happening now. build
is building the sdist first, which does rely on the file finders, but then builds the wheel from the sdist, which relies on the manifest in the sdist. I'll have to revisit the original project (distutils) to see where things are going wrong there (why nothing is being discovered).
Aha. So I've clarified my confusion. The errors are expected to be emitted. They just need not to appear during the sdist phase. The reason there were issues with the distutils build was not because of scm file finders, but because of an exclude directive. The error from setuptools_scm was a red herring.
@jaraco , sorry but your last two comments are a little too technical for me to understand. I get this same error every time I do a build even though the build seems successful. How can I get rid of that error message?
Because of the way setuptools is engineered, it will necessarily involve setuptools_scm
at both phases of the build, during the sdist and then again at the wheel. It's okay to see the error message during the wheel build because it no longer needs the SCM metadata because that's been embedded in the sdist during the sdist phase. In short, I don't think there is currently a way for Setuptools or setuptools_scm to know that it's doing a "wheel from sdist" and thus to disable features like "search for files using git metadata". Therefore, I don't think there's a way to get rid of the error message. Perhaps there's something that could be done, but it would require coordination between build and the backends (setuptools) and their plugins (setuptools_scm).
I'll move this issue to packaging-problems for consideration.
Thanks for your reply.
The message reports a big fat ERROR, not even a warning so I assumed I must have a mistake somewhere and have spent ages trying different fixes which did not change anything. It is disconcerting to see that ERROR reported so this clearly must be considered a bug.
Is there anything we can to do avoid this message or the only option is to attempt to switch to another packaging alternative? Clearly the linked packaging issue seems to claim is a setuptools issue and not generic packaging one.
To my surprise i seen two that updated their scm to 8 to get rid of if, but that does not seem to be the case.
The error only ought to happen when git is detected but breaks horribly
We might be able to narrow it down better if the file finder hooks received more than a path
Unfortunately they don't so there's situations with false positives outweigh ing the rwst atm
I just took a look again, theres a bug in finding the git top level that's in need of a fix
While troubleshooting https://github.com/pypa/distutils/issues/224, I've stumbled onto another issue.
I'm running
pyproject-build .
on a number of projects, and in the output, I see the following warning for both sdist and wheel generation:This is happening across multiple projects I develop.
If I install the build requirements locally and run
py -m build --no-isolation .
and put a breakpoint in thesetuptools_scm._file_finders.git:_git_toplevel
, I see that when the error occurs, the git command is being run against a copy of the source that doesn't include the git directory. Something about the build ecosystem is causing the .git directory that I clearly cloned not to be included in the build. I tried running with some older versions of build going back to 0.9, but that didn't seem to make a difference.So far, I've only replicated this on my own system. I'd test in an isolated environment, but I don't have ready access to Docker at the moment. I'll test again after restoring Docker.