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
Add a --dry-run mode #207
Comments
|
Maybe something like #19 (which i haven't looked at yet, but has conflicts). |
I'm confused. There are very few failure modes of twine. I'm not sure something that doesn't talk to PyPI (or something like it) could be useful, but I'm not sure what else to offer you beyond a test server. Frankly what I'm imagining would be more useful is something that provides a local URL, credentials, and allows you to actually use Twine as an E2E test. A test fixture along the lines of |
|
Yep, this would be a sanity check to make sure the built Debian package didn't break something. E.g. maybe we left off a new dependency, or broke a delta patch we might need against upstream. In Debian and Ubuntu we have nice infrastructure to automatically run tests, not just at build time which usually run the package's own test suite, but after build where the .debs are installed in a chroot and tested. FWIW, build-time tests can't touch the internet, but after-build tests can. A test/staging server which just threw away the data could be useful, as would be a fixture as you describe. The latter would only test localhost, but that might be enough. And I suppose that fixture wouldn't necessarily have to go in twine, although it would be nice to have. (FWIW, we do something similar in the Mailman test suite where we create a fake local http to talk to during various tests.) |
|
Maybe @dstufft has other thoughts, e.g. perhaps there's something in Warehouse we can fake-talk to? |
|
Nah, there's nothing in Warehouse to fake-talk to. You'd have to create your own fake server, but the upload API isn't very complicated if you don't care about doing the "make sure permissions and the valid contained within the package" is valid stuff. |
|
I think all I'd want is to verify that there are some credentials (e.g. the package has a valid signature but that signature needn't be associated with any particular user), and that the package looks sane-ish, meaning the file has the right format (e.g. no .tbz extension ) but it doesn't need to crack open the file and look at the contents. |
So, twine only verifies credentials to PyPI (if you think using them as authentication is verification). We do not verify signatures and PyPI/Warehouse do not associate signatures with particular users.
Twine doesn't look to enforce prohibited file types (especially since the PEP has yet to be accepted which adds those restrictions). Once we do, I would expect that simply providing that file would fail before even talking to the internet (thereby not requiring a server of any sort). |
|
When I want a dry run of a PyPI upload, here's what I want to check:
I'd welcome @michaeljoseph's point of view here since I'd like to better understand what happened with #19 - was it more of a WONTFIX, or was it just closed because it was stale, or something else? cc @sigmavirus24 |
|
It was closed 4 years after and was no longer relevant. Listing the items for upload seems reasonable. I think everything else that you're talking about is actually a totally separate command. Something like |
|
The draft guide for gracefully dropping support for older Python versions includes a step where you check that your metadata is as you intended before you actually hit publish: https://github.com/pypa/python-packaging-user-guide/pull/459/files#diff-844d448f2675b425642dad8328eaff9eR60 The current draft of that section is While this technically could be a separate command, I think a potential side benefit of incorporating it into |
|
I really don't like printing out random things in |
|
Yeah, that's a fair criticism, and I'm not especially hung up on the |
|
Yes please.. a |
|
I think this would be very useful when working on CICD. |
|
There doesn't seem to be a single agreed upon set of constraints here. I'm not sure there is value here in the various proposals to be totally honest. @bhrutledge do you agree? |
|
I agree. From a quick scan, it seems like uploading to https://test.pypi.org/ first might cover some of the asks. Also, it seems like this would require support from Warehouse. |
When building the Debian package version of twine, I'd love to have an end-to-end test that I can automate which actually hits PyPI, but I don't want to do an actual upload and I don't want to have to put real credentials in the package.
One idea would be to add a --dry-run mode which would allow me to pretend to upload a fake package with fake credentials, and would report back if the upload would have been successful if both of those were real data.
Any other suggestions for allowing me to automate such a test would be welcome!
The text was updated successfully, but these errors were encountered: