This is great stuff!
I’d be happy to help in any way to gain more traction on this. I’ll answer what questions/comments I can regarding the PR that I made proposing an implementation for some of the features mentioned in this PEP.
Yes, the PR creates an md5 hash of the project name + the version number of the release you’re drafting. It could definitely be something else, but as you mentioned, it is still an open question how obscure or how reproducible we want that to be. Ideally, it’s something that only maintainers and the systems they control can use, without requiring authentication. I landed on the current hash as a middle point between “it’s always <my_project>-draft for ease of use!” and “it’s random UUID string”.
One important difference is that in my implementation there were no proposed changes to the API responses, so there was no way to give that random string back to upload clients, and thus had to be shared through the website. This PEP changes that constraint, and opens up more possibilities on how that draft url can look like
If I recall correctly, in the PR implementation the project does get created, but with no versions listed on the simple index, and I think you’d get a 404 if you were to navigate to https://pypi.org/project/my-package
. The project and release both exists, but the single draft release wouldn’t be discoverable.
Yes, using the current PR you’d be able to test the installation of your draft release for package A with the draft releases of B and C by supplying a --extra-index-url
parameter for each package. I don’t recall if I tested this use case specifically, but I have a strong recollection of talking about it and it being supported under that implementation.
If we were receiving the release metadata from warehouse in the form of draft:token
, then it could be possible to pass a --draft <token>
param to clients and have them or warehouse resolve that into the corresponding repository to get the draft release from. However, as I understand it this would mean a separate proposal for client implementations to agree on taking and using that new token
through the --draft
param. Although the UX is a bit less nice, the reuse of --extra-index-url
gives us “free” compatibility with implementation clients that already support it.
I believe there’s a big difference between both approaches due to the way the Pyramid maps URLs to views using a Traversal algorithm, and if I recall correctly the draft hash needs to be present as part of the /path/to/release
. But I might be wrong! It was my first time writing Pyramid code.
Yes, it’s incorrect! The deletion of draft releases is intended, and one of their main benefits. I remember testing the uploading, then deleting, then re-uploading of a release during development. I think I simply forgot to update that admonition text