You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: peps/pep-0694.rst
+34-9Lines changed: 34 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -171,11 +171,19 @@ these steps:
171
171
Versioning
172
172
----------
173
173
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.
177
178
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.
179
187
180
188
Content Types
181
189
-------------
@@ -209,14 +217,19 @@ defined in this PEP **MUST** include a ``Content-Type`` header value of:
209
217
- ``application/vnd.pypi.upload.v2+json``.
210
218
211
219
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.
216
226
Clients only have a single version and serialization they can request.
217
227
However clients **SHOULD** be prepared to handle content negotiation gracefully
218
228
in the case that additional formats or versions are added in the future.
219
229
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
+
220
233
Unless otherwise specified, all HTTP requests and responses in this document are assumed to include
221
234
the HTTP header:
222
235
@@ -876,7 +889,9 @@ Each major version of the Upload API **MUST** specify at least one required File
876
889
877
890
New required mechanisms **MUST NOT** be added
878
891
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.
880
895
881
896
.. _required-file-upload-mechanisms:
882
897
@@ -936,15 +951,25 @@ and contain only alphanumeric characters ``[a-z0-9]``.
936
951
The ``implementation identifier`` **SHOULD** concisely describe the underlying implementation
937
952
and contain only alphanumeric characters ``[a-z0-9]`` and ``-``.
938
953
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
0 commit comments