@@ -13,8 +13,8 @@ Post-History: `27-Jun-2022 <https://discuss.python.org/t/pep-694-upload-2-0-api-
13
13
Abstract
14
14
========
15
15
16
- There currently is not a standardized API for uploading files to a Python package
17
- repository such as PyPI. Instead everyone has been forced to reverse engineer
16
+ There is currently no standardized API for uploading files to a Python package
17
+ repository such as PyPI. Instead, everyone has been forced to reverse engineer
18
18
the non-standard API from PyPI.
19
19
20
20
That API, while functional, leaks a lot of implementation details of the original
@@ -38,10 +38,10 @@ Beyond the above, there are a number of major issues with the current API:
38
38
not go last, possibly some hard to build packages are attempting to be built
39
39
from source.
40
40
41
- - It has very limited support for communicating back to the user, limited entirely
42
- to the HTTP status code, and status message (something which I'm not sure is
43
- even technically valid HTTP?). It has no support for multiple errors, warnings,
44
- deprecations, etc.
41
+ - It has very limited support for communicating back to the user, with no support
42
+ for multiple errors, warnings, deprecations, etc. It is limited entirely to the
43
+ HTTP status code and reason phrase, of which the reason phrase has been
44
+ deprecated since HTTP/2 ( :rfc: ` RFC 7540 < 7540#section-8.1.2.4 >`).
45
45
46
46
- The metadata for a release/file is submitted alongside the file, however this
47
47
metadata is famously unreliable, and most installers instead choose to download
@@ -119,20 +119,20 @@ roughly two things:
119
119
- The metadata is submitted alongside the file, rather than being parsed from the
120
120
file itself.
121
121
122
- - This is actually fine if used as a pre-check, but it should be reconciled
122
+ - This is actually fine if used as a pre-check, but it should be validated
123
123
against the actual ``METADATA `` or similar files within the distribution.
124
124
125
125
- It supports a single request, using nothing but form data, that either succeeds
126
126
or fails, and everything is done and contained within that single request.
127
127
128
- We then propose a multiple request workflow, that essentially boils down to:
128
+ We then propose a multi- request workflow, that essentially boils down to:
129
129
130
130
1. Initiate an upload session.
131
131
2. Upload the file(s) as part of the upload session.
132
132
3. Complete the upload session.
133
133
4. (Optional) Check the status of an upload session.
134
134
135
- All URLs described here will be relative to the root end point , which may be
135
+ All URLs described here will be relative to the root endpoint , which may be
136
136
located anywhere within the url structure of a domain. So it could be at
137
137
``https://upload.example.com/ ``, or ``https://example.com/upload/ ``.
138
138
@@ -263,7 +263,7 @@ to actually upload each of those files.
263
263
264
264
There is no set endpoint for actually uploading the file, that is given to the
265
265
client by the server as part of the creation of the upload session, and clients
266
- **MUST NOT ** assume that there is any stability to what those URLs look like from
266
+ **MUST NOT ** assume that there is any commonality to what those URLs look like from
267
267
one session to the next.
268
268
269
269
To initiate a file upload, a client sends a ``POST `` request to the upload URL
@@ -298,7 +298,7 @@ Besides the standard ``meta`` key, this currently has 4 keys:
298
298
299
299
Multiple hashes may be passed at a time, but all hashes must be valid for the
300
300
file.
301
- - ``metadata ``: An optional key that is a string that contains the file's
301
+ - ``metadata ``: An optional key that is a string containing the file's
302
302
`core metadata <https://packaging.python.org/en/latest/specifications/core-metadata/ >`_.
303
303
304
304
Servers **MAY ** use the data provided in this response to do some sanity checking
@@ -364,7 +364,7 @@ repository, but merely staged until the upload session has completed.
364
364
To upload in multiple chunks, a client sends multiple ``POST `` requests to the same
365
365
URL as before, one for each chunk.
366
366
367
- However, this time the ``Content-Length `` is equal to the size, in bytes, of the
367
+ This time however, the ``Content-Length `` is equal to the size, in bytes, of the
368
368
chunk that they are sending. In addition, the client **MUST ** include a
369
369
``Upload-Offset `` header which indicates a byte offset that the content included
370
370
in this request starts at and a ``Upload-Incomplete `` header set to ``1 ``.
@@ -443,7 +443,7 @@ Session Status
443
443
444
444
Similarly to file upload, the session URL is provided in the response to
445
445
creating the upload session, and clients **MUST NOT ** assume that there is any
446
- stability to what those URLs look like from one session to the next.
446
+ commonality to what those URLs look like from one session to the next.
447
447
448
448
To check the status of a session, clients issue a ``GET `` request to the
449
449
session URL, to which the server will respond with the same response that
@@ -515,7 +515,7 @@ a ``source`` key, which is a string that indicates what the source of the
515
515
error is, and a ``messasge `` key for that specific error.
516
516
517
517
The ``message `` and ``source `` strings do not have any specific meaning, and
518
- are intended for humans to interpet to figure out what the underlying issue
518
+ are intended for human interpetation to figure out what the underlying issue
519
519
was.
520
520
521
521
0 commit comments