@@ -27,29 +27,42 @@ POST request with the following fields:
27
27
- ` :action ` set to ` file_upload `
28
28
- ` protocol_version ` set to ` 1 `
29
29
- ` content ` with the file to be uploaded and the proper filename
30
- (i.e . ` my_foo_bar-4.2-cp36-cp36m-manylinux1_x86_64.whl ` )
30
+ (e.g . ` my_foo_bar-4.2-cp36-cp36m-manylinux1_x86_64.whl ` )
31
31
- One of the following hash digests:
32
32
- ` md5_digest ` set to the md5 hash of the uploaded file in urlsafe base64
33
- with no padding
33
+ with no padding
34
34
- ` sha256_digest ` set to the SHA2-256 hash in hexadecimal
35
35
- ` blake2_256_digest ` set to the Blake2b 256-bit hash in hexadecimal
36
- - ` filetype ` set to the type of the artifact, i.e. ` bdist_wheel `
37
- or ` sdist `
38
- - When used with ` bdist_wheel ` for ` filetype ` , ` pyversion ` must be set to
39
- a specific release, i.e. ` cp36 ` , when used with ` sdist ` it must be set to
40
- ` source `
41
- - ` metadata_version ` , ` name ` and ` version ` set according to the
36
+ - ` filetype ` must be set to the type of the artifact: ` bdist_wheel ` or ` sdist ` .
37
+ - ` pyversion ` must be set to a [ Python tag] for ` bdist_wheel ` uploads,
38
+ or ` source ` for ` sdist ` uploads.
39
+ - ` metadata_version ` , ` name ` and ` version ` must be set according to the
42
40
[ Core metadata specifications]
43
41
- ` attestations ` can be set to a JSON array of [ attestation objects] .
44
42
PyPI will reject the upload if it can't verify each of the
45
43
supplied attestations.
46
- - You can set any other field from the [ Core metadata specifications]
47
- All fields need to be renamed to lowercase and hyphens need to replaced
48
- by underscores. So instead of "` Description-Content-Type ` " the field must be
49
- named "` description_content_type ` ". Note that adding a field
50
- "` Description-Content-Type ` " will not raise an error but will be silently
51
- ignored.
44
+ - You can set any other field from the [ Core metadata specifications] .
45
+
46
+ All fields need to be renamed to lowercase and hyphens need to replaced
47
+ by underscores. Additionally, multiple-use fields (like ` Classifier ` )
48
+ are pluralized (e.g. ` classifiers ` ) with some limited exceptions
49
+ noted below:
50
+
51
+ | Metadata field | Form field |
52
+ | ----------------| ------------|
53
+ | ` Platform ` | ` platform ` (** not** ` platforms ` ) |
54
+ | ` Supported-Platform ` | ` supported_platform ` (** not** ` supported_platforms ` ) |
55
+ | ` License-File ` | ` license_file ` (** not** ` license_files ` ) |
56
+
57
+
58
+ !!! warning
59
+
60
+ The transformation above *must* be performed.
61
+ Sending a form field like `Description-Content-Type` will not raise an
62
+ error but will be **silently ignored**.
52
63
53
64
[ attestation objects ] : ./integrity.md#concepts
54
65
55
66
[ Core metadata specifications ] : https://packaging.python.org/specifications/core-metadata
67
+
68
+ [ Python tag ] : https://packaging.python.org/en/latest/specifications/platform-compatibility-tags/#python-tag
0 commit comments