Skip to content

Commit 472a796

Browse files
committed
clarify who owns what version specifiers
1 parent fd0e6f5 commit 472a796

File tree

1 file changed

+34
-9
lines changed

1 file changed

+34
-9
lines changed

peps/pep-0694.rst

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,19 @@ these steps:
171171
Versioning
172172
----------
173173

174-
This PEP uses the same ``MAJOR.MINOR`` versioning system as used in :pep:`691`, but it is otherwise
175-
independently versioned. The legacy API is considered by this PEP to be version ``1.0``, but this
176-
PEP does not modify the legacy API in any way.
174+
This PEP uses the same ``MAJOR.MINOR`` versioning system as used in :pep:`691`,
175+
but it is otherwise independently versioned.
176+
The legacy API is considered by this PEP to be version ``1.0``,
177+
but this PEP does not modify the legacy API in any way.
177178

178-
The API proposed in this PEP therefor has the version number ``2.0``.
179+
The API proposed in this PEP therefore has the version number ``2.0``.
180+
181+
Both major and minor version numbers of the Upload API
182+
**MUST** only be changed through the PEP process.
183+
Index operators and implementers **MUST NOT** advertise or implement
184+
new API versions without an approved PEP.
185+
This ensures consistency across all implementations
186+
and prevents fragmentation of the ecosystem.
179187

180188
Content Types
181189
-------------
@@ -209,14 +217,19 @@ defined in this PEP **MUST** include a ``Content-Type`` header value of:
209217
- ``application/vnd.pypi.upload.v2+json``.
210218

211219
Similar to :pep:`691`, this PEP also standardizes on using server-driven content negotiation to
212-
allow clients to request different versions or serialization formats, which includes the ``format``
213-
part of the content type. However, since this PEP expects the existing legacy ``1.0`` upload API
214-
to exist at a different endpoint, and this PEP currently only provides for JSON serialization, this
215-
mechanism is not particularly useful.
220+
allow clients to request different versions or serialization formats,
221+
which includes the ``format`` part of the content type.
222+
However, since this PEP expects the existing legacy ``1.0`` upload API
223+
to exist at a different endpoint,
224+
and this PEP currently only provides for JSON serialization,
225+
this mechanism is not particularly useful.
216226
Clients only have a single version and serialization they can request.
217227
However clients **SHOULD** be prepared to handle content negotiation gracefully
218228
in the case that additional formats or versions are added in the future.
219229

230+
Servers **MUST NOT** advertise support for API versions beyond those defined in approved PEPs.
231+
Any new versions or formats require standardization through a new PEP.
232+
220233
Unless otherwise specified, all HTTP requests and responses in this document are assumed to include
221234
the HTTP header:
222235

@@ -876,7 +889,9 @@ Each major version of the Upload API **MUST** specify at least one required File
876889

877890
New required mechanisms **MUST NOT** be added
878891
and existing required mechanisms **MUST NOT** be removed
879-
without an update to the :ref:`major version <versioning>`. Any server-specific or experimental mechanisms added or removed **MUST NOT** change the major or minor version number of this specification.
892+
without an update to the :ref:`major version <versioning>`.
893+
Any server-specific or experimental mechanisms added or removed
894+
**MUST NOT** change the major or minor version number of this specification.
880895

881896
.. _required-file-upload-mechanisms:
882897

@@ -936,15 +951,25 @@ and contain only alphanumeric characters ``[a-z0-9]``.
936951
The ``implementation identifier`` **SHOULD** concisely describe the underlying implementation
937952
and contain only alphanumeric characters ``[a-z0-9]`` and ``-``.
938953

954+
When server operators need to make breaking changes to their upload mechanisms,
955+
they **SHOULD** create a new mechanism identifier rather than modifying the existing one.
956+
The recommended pattern is to append a version suffix like ``-v1``, ``-v2``, etc.
957+
to the implementation identifier.
958+
This allows clients to explicitly opt into new versions while maintaining
959+
backward compatibility with existing clients.
960+
939961
For example:
940962

941963
====================================== ================ =========================================================================
942964
File Upload Mechanism string Server Operator Mechanism description
943965
====================================== ================ =========================================================================
944966
``vnd-pypi-s3multipart-presigned`` PyPI S3 multipart upload via pre-signed URL
967+
``vnd-pypi-s3multipart-presigned-v2`` PyPI S3 multipart upload via pre-signed URL version 2
945968
``vnd-pypi-http-fetch`` PyPI File delivered by instructing server to fetch from a URL via HTTP request
946969
``vnd-acmecorp-http-fetch`` Acme Corp File delivered by instructing server to fetch from a URL via HTTP request
947970
``vnd-acmecorp-postal`` Acme Corp File delivered via postal mail
971+
``vnd-widgetinc-stream-v1`` Widget Inc. Streaming upload protocol version 1
972+
``vnd-widgetinc-stream-v2`` Widget Inc. Streaming upload protocol version 2
948973
``vnd-madscience-quantumentanglement`` Mad Science Labs Upload via quantum entanglement
949974
====================================== ================ =========================================================================
950975

0 commit comments

Comments
 (0)