Skip to content

Commit bcc345b

Browse files
committed
Further updates based on DPO thread
* The addition of the ``Location`` header is now a **MUST**, and better worded to indicate that it can be polled in the case of a ``202 Accepted``. * Added a couple of **FIXME** tags to address removal of nonce and fleshing out the ``Errors`` section. See URLs in the text. DO NOT PROMOTE FROM DRAFT UNTIL THIS IS DONE. * Reformatted some text.
1 parent 5c16ed2 commit bcc345b

File tree

1 file changed

+16
-20
lines changed

1 file changed

+16
-20
lines changed

peps/pep-0694.rst

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,9 @@ In addition, there are a number of major issues with the legacy API:
8181
* Creation of new projects requires the uploading of at least one file, leading to "stub" uploads
8282
to claim a project namespace.
8383

84-
The new upload API proposed in this PEP provides ways to solve all of these problems,
85-
either directly or through an extensible approach,
86-
allowing servers to implement features such as resumable and parallel uploads.
87-
This upload API this PEP proposes provides
88-
better error reporting,
89-
a more robust release testing experience,
84+
The new upload API proposed in this PEP provides ways to solve all of these problems, either directly or
85+
through an extensible approach, allowing servers to implement features such as resumable and parallel uploads.
86+
This upload API this PEP proposes provides better error reporting, a more robust release testing experience,
9087
and atomic and simultaneous publishing of all release artifacts.
9188

9289
Legacy API
@@ -276,6 +273,8 @@ are determined by the index operator.
276273
Errors
277274
------
278275

276+
**FIXME**: https://discuss.python.org/t/pep-694-pypi-upload-api-2-0-round-2/101483/20
277+
279278
All error responses that contain content look like:
280279

281280
.. code-block:: json
@@ -331,6 +330,8 @@ A release starts by creating a new Publishing Session. To create the session, a
331330
"nonce": "<string>"
332331
}
333332
333+
**FIXME: (get rid of ``nonce``): https://discuss.python.org/t/pep-694-pypi-upload-api-2-0-round-2/101483/22
334+
334335

335336
The request includes the following top-level keys:
336337

@@ -528,10 +529,9 @@ If the server is able to immediately complete the Publishing Session, it may do
528529
(for instance, if it needs to do validation that may take longer than reasonable in a single HTTP
529530
request), then it may return a ``202 Accepted`` response.
530531

531-
In either case, the server should include a ``Location`` header pointing back to
532-
the Publishing Session status URL,
533-
and if the server returned a ``202 Accepted``,
534-
the client may poll that URL to watch for the status to change.
532+
The server **MUST** include a ``Location`` header in the response pointing back to the :ref:`Publishing
533+
Session status <session-status>` URL, which can be used to query the current session status. If the server
534+
returned a ``202 Accepted``, polling that URL can be used to watch for session status changes.
535535

536536
If an error occurs, the appropriate ``4xx`` code should be returned, as described in the
537537
:ref:`session-errors` section.
@@ -683,16 +683,12 @@ the file to be uploaded. These checks may include, but are not limited to:
683683

684684
- checking if the contents of the ``metadata``, if provided, are valid.
685685

686-
If the server determines that upload should proceed, it will return a ``202 Accepted`` response,
687-
with the response body below.
688-
The :ref:`status <session-status>` of the session will also include
689-
the filename in the ``files`` mapping.
690-
If the server cannot proceed with an upload because
691-
the ``mechanism`` supplied by the client is not supported
692-
it **MUST** return a ``422 Unprocessable Entity``.
693-
If the server determines the upload cannot proceed,
694-
it **MUST** return a ``409 Conflict``.
695-
The server **MAY** allow parallel uploads of files, but is not required to.
686+
If the server determines that upload should proceed, it will return a ``202 Accepted`` response, with the
687+
response body below. The :ref:`status <session-status>` of the session will also include the filename in the
688+
``files`` mapping. If the server cannot proceed with an upload because the ``mechanism`` supplied by the
689+
client is not supported it **MUST** return a ``422 Unprocessable Content``. The server **MAY** allow parallel
690+
uploads of files, but is not required to. If the server determines the upload cannot proceed, it **MUST**
691+
return a ``409 Conflict``.
696692

697693
.. _file-upload-session-response:
698694

0 commit comments

Comments
 (0)