Skip to content

Add semantics for drafts#2

Closed
di wants to merge 1 commit into
dstufft:draft-pypi-upload-2-0from
di:draft-semantics
Closed

Add semantics for drafts#2
di wants to merge 1 commit into
dstufft:draft-pypi-upload-2-0from
di:draft-semantics

Conversation

@di
Copy link
Copy Markdown

@di di commented Jun 26, 2022

This attempts to keep the URL structure clean by reusing the root to list draft sessions and including per-session URLs. The only thing I'm not totally sure about is the empty POST to publish a draft session, but happy to take edits anywhere.

@di di requested a review from dstufft June 26, 2022 20:36
Comment thread pep-9999.rst
the server wishes to communicate to the end user that are not specific to any
one file.

The ``url`` key represents a unique and absolute URL for the session. This is
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this different than the url in the Location header?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I missed that! I don't think so, seems like we can remove this.

Comment thread pep-9999.rst
~~~~~~~~~~~~~~~~~~~

In order to determine which draft sessions the server is aware of and are
pending publication, servers **MUST** support enumerating draft sessions. When
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to support enumeration? If you've already gotten a session, can't you just use the URL you've already received?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm imagining a release process like the one used for pyca/cryptography, where they build and upload from multiple different environments (to get platform/architecture coverage). This means that a specific build environment doesn't have a priori knowledge of other related upload sessions, but you still want a way to collect all the artifacts for a given release (with multiple upload sessions) maybe run some tests or something, and then request that the sessions are all published simultaneously (which this doesn't necessarily account for since they'd have to make 1 request per upload session, but I'm assuming we'd provide the same session url for the same name+version, so it would be 1 request for PyPI)

I'm also imagining a workflow where a user iterating on multiple candidate artifacts for a given release via drafts, and doesn't have a great way to persist the upload session url between attempts (like maybe they're running twine upload --draft multiple times). And since we're saying the URL is not predictable and can change, we'd need a way to determine which sessions are available to publish when they run twine publish or whatever

@di
Copy link
Copy Markdown
Author

di commented Jun 28, 2022

Seems like this is unnecessary now that the PEP has been modified to include support for publishing drafts.

@di di closed this Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants