-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Bug(?): uv publish fails if unknown files are present in ./dist #8944
Comments
Thanks for the report! We'll take a look -- does seem like an oversight. |
I also saw a similar error that may be related when running
After doing a P.S. I'm usin |
Interesting, did you open the uv cache manually at some point? |
Yes, I inspected it a little bit. |
Is the fix ecccfa0 only for |
@maliayas your case is unrelated to the |
Description
When a file is created in the
./dist
directory before runninguv publish
, this file causesuv publish
to fail. The documentation states that it ignores all other files.uv/docs/reference/cli.md
Line 7835 in 04c445a
This issue is clearly minor and does not really impact the user much (the error message is quite clear).
However, I think there is no reason to fail if an unknown file is present – as long as a wheel and/or sdist file is found.
If this failure is deliberate, then I would recommend change the documentation.
Steps to reproduce
uv build
). The build files will be generated in./dist
../dist
directory. On macOS, this could happen e.g. when opening the directory in Finder, which might create the.DS_Store
file. Example:touch ./dist/.DS_Store
uv publish
.This will fail with the error:
error: File is neither a wheel nor a source distribution: 'dist/.DS_Store'
Where does this error come from
The error is raised in
uv_publish::files_for_publishing
:uv/crates/uv-publish/src/lib.rs
Lines 257 to 258 in 0b4e5cf
uv_distribution_filename::DistFilename::try_from_normalized_filename
in turn checks if the files are valid wheel or sdist files. Example for wheels:uv/crates/uv-distribution-filename/src/wheel.rs
Lines 29 to 34 in 0b4e5cf
Meta
uv version:
The text was updated successfully, but these errors were encountered: