-
-
Notifications
You must be signed in to change notification settings - Fork 277
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
Implement maturin upload
command
#484
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for working on finishing this!
src/main.rs
Outdated
if files.is_empty() { | ||
println!("⚠ Warning: No files given, exiting."); | ||
return Ok(()); | ||
} | ||
let metadata: Vec<Vec<(String, String)>> = files | ||
|
||
// FIXME: All uploaded files are expected to share the build context |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the easiest way to check this is to read all metadata and check they are equal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added a sanity check ensuring that all wheels come from the same Python package.
Readme.md
Outdated
``` | ||
Uploads the distribution files to the repository (package index) | ||
|
||
It behaves like `twine upload`, but is restricted to the python wheels and source distributions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't be so bold to claim that it has the same behaviour as twine
. There are a lot of edge cases maturin doesn't (and will never) cover.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've reworded it to look more like the original comment.
Split out the maturin build context members from `PublishOpt`. Extract the build context handling code from `upload_ui()`. The existing functionality is not changed in this commit. The trimmed publish options structure will be reused for the new `maturin upload` command.
Uploads a set of wheels and/or source distributions that belong to a single python package. Refuse to upload files from different packages in one command invocation.
Applied suggestions and rebased on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again!
Note that currently the source distribution upload fails because the |
Does it? I don't make source distributions myself, but I've tried to upload |
I just tried the following on the main branch:
|
Hmm, that means the source distribution tarball that the current maturin version builds for |
I totally missed that! Initially I implemented source distributions with |
It behaves like
twine upload
, but is restricted to the python wheels and source distributions.The upload command mostly reuses the publish command implementation.