-
Notifications
You must be signed in to change notification settings - Fork 125
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
Build includes an old file that had been removed from the souce code #291
Comments
Thanks for reporting. This is not an issue with build, which is just a frontend for other build tools - in this case, setuptools. The setuptools wheel builder merges the contents of the package folder it keeps in the "build" folder with every consecutive run (see pypa/wheel#147). To ensure that this does not happen in the future, delete your "build" folder before rebuilding. |
Exactly, |
Thanks for the fast response. Okay, so if deleting the 'build' folder before running "python -m build" is required, why doesn't the "build" package do it for you? Is there a reason why we should do this manually? |
Setuptools decides this, how is build supposed to know it's safe to delete some folder? And this is setuptools specific, other build tools do different things, and build cannot/should not be in the business of manually "improving" them. In general, you should be running build on a fresh checkout, probably in CI. Or always do a full git clean before running. Setuptools is really bad about picking up files that are not supposed to be there. Also I recommend running check-manifest. |
build doesn't even know the "build" folder exists. |
My environment:
Operating System: Windows 10 Pro, Version 20H2, OS Build 19042.964
Python version: 3.9.4
Build installed via: python -m pip install --upgrade build
Build version: 0.3.1.post1
Published PyPI containing the build error: https://pypi.org/project/pyalmanac/1.2/
Problem description:
I recently noticed an incorrect build - the build included a file that I had deleted from the sources.
In my app/pyalmanac/lib folder I had 8 files, however one was a older copy that was not needed:
The last file should not be part of the built distribution. So I deleted it (also deleting the two files in app/dist) and re-ran "python -m build". I did not notice until later that "alma_ephem - Copy.py" was still part of the distribution. In fact I found it cached in app/build/lib/pyalmanac/lib folder. ONLY AFTER DELETING THE app/build FOLDER entirely did the build run correctly.
I hope you have enough information to detect the issue, if not, I'll gladly be of further assistance. My suspicion is that only the first 10 characters (alma_ephem) are compared, which also matches "alma_ephem - Copy" so it thinks it should remain in the distribution set. Just guessing! Thanks for your assistance.
The text was updated successfully, but these errors were encountered: