Skip to content

Commit 21dff31

Browse files
WouterkoornJelleZijlstradstufft
authored
PEP 694: Grammar changes + reason phrase deprecation mention (#2685)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> Co-authored-by: Donald Stufft <donald@stufft.io>
1 parent 135e66f commit 21dff31

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

pep-0694.rst

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ Post-History: `27-Jun-2022 <https://discuss.python.org/t/pep-694-upload-2-0-api-
1313
Abstract
1414
========
1515

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
1818
the non-standard API from PyPI.
1919

2020
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:
3838
not go last, possibly some hard to build packages are attempting to be built
3939
from source.
4040

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>`).
4545

4646
- The metadata for a release/file is submitted alongside the file, however this
4747
metadata is famously unreliable, and most installers instead choose to download
@@ -119,20 +119,20 @@ roughly two things:
119119
- The metadata is submitted alongside the file, rather than being parsed from the
120120
file itself.
121121

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
123123
against the actual ``METADATA`` or similar files within the distribution.
124124

125125
- It supports a single request, using nothing but form data, that either succeeds
126126
or fails, and everything is done and contained within that single request.
127127

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:
129129

130130
1. Initiate an upload session.
131131
2. Upload the file(s) as part of the upload session.
132132
3. Complete the upload session.
133133
4. (Optional) Check the status of an upload session.
134134

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
136136
located anywhere within the url structure of a domain. So it could be at
137137
``https://upload.example.com/``, or ``https://example.com/upload/``.
138138

@@ -263,7 +263,7 @@ to actually upload each of those files.
263263

264264
There is no set endpoint for actually uploading the file, that is given to the
265265
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
267267
one session to the next.
268268

269269
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:
298298

299299
Multiple hashes may be passed at a time, but all hashes must be valid for the
300300
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
302302
`core metadata <https://packaging.python.org/en/latest/specifications/core-metadata/>`_.
303303

304304
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.
364364
To upload in multiple chunks, a client sends multiple ``POST`` requests to the same
365365
URL as before, one for each chunk.
366366

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
368368
chunk that they are sending. In addition, the client **MUST** include a
369369
``Upload-Offset`` header which indicates a byte offset that the content included
370370
in this request starts at and a ``Upload-Incomplete`` header set to ``1``.
@@ -443,7 +443,7 @@ Session Status
443443

444444
Similarly to file upload, the session URL is provided in the response to
445445
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.
447447

448448
To check the status of a session, clients issue a ``GET`` request to the
449449
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
515515
error is, and a ``messasge`` key for that specific error.
516516

517517
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
519519
was.
520520

521521

0 commit comments

Comments
 (0)