@@ -108,11 +108,6 @@ class PythonPackageContentSerializer(core_serializers.SingleArtifactContentUploa
108
108
required = False , allow_blank = True ,
109
109
help_text = _ ('A longer description of the package that can run to several paragraphs.' )
110
110
)
111
- description_content_type = serializers .CharField (
112
- required = False , allow_blank = True ,
113
- help_text = _ ('A string stating the markup syntax (if any) used in the distribution’s'
114
- ' description, so that tools can intelligently render the description.' )
115
- )
116
111
keywords = serializers .CharField (
117
112
required = False , allow_blank = True ,
118
113
help_text = _ ('Additional keywords to be used to assist searching for the '
@@ -195,6 +190,23 @@ class PythonPackageContentSerializer(core_serializers.SingleArtifactContentUploa
195
190
required = False , default = list ,
196
191
help_text = _ ('A JSON list containing classification values for a Python package.' )
197
192
)
193
+ # Metadata 2.1
194
+ description_content_type = serializers .CharField (
195
+ required = False , allow_blank = True ,
196
+ help_text = _ ('A string stating the markup syntax (if any) used in the distribution’s'
197
+ ' description, so that tools can intelligently render the description.' )
198
+ )
199
+ provides_extra = serializers .JSONField (
200
+ required = False , default = list ,
201
+ help_text = _ ('A JSON list containing names of optional features provided by the package.' )
202
+ )
203
+ # Metadata 2.2
204
+ dynamic = serializers .JSONField (
205
+ required = False , default = list ,
206
+ help_text = _ ('A JSON list containing names of other core metadata fields which are '
207
+ 'permitted to vary between sdist and bdist packages. Fields NOT marked '
208
+ 'dynamic MUST be the same between bdist and sdist.' )
209
+ )
198
210
199
211
def deferred_validate (self , data ):
200
212
"""
@@ -251,10 +263,11 @@ def retrieve(self, validated_data):
251
263
class Meta :
252
264
fields = core_serializers .SingleArtifactContentUploadSerializer .Meta .fields + (
253
265
'filename' , 'packagetype' , 'name' , 'version' , 'sha256' , 'metadata_version' , 'summary' ,
254
- 'description' , 'description_content_type' , 'keywords' , 'home_page' , 'download_url' ,
255
- 'author' , 'author_email' , 'maintainer' , 'maintainer_email' , 'license' ,
256
- 'requires_python' , 'project_url' , 'project_urls' , 'platform' , 'supported_platform' ,
257
- 'requires_dist' , 'provides_dist' , 'obsoletes_dist' , 'requires_external' , 'classifiers'
266
+ 'description' , 'keywords' , 'home_page' , 'download_url' , 'author' , 'author_email' ,
267
+ 'maintainer' , 'maintainer_email' , 'license' , 'requires_python' , 'project_url' ,
268
+ 'project_urls' , 'platform' , 'supported_platform' , 'requires_dist' , 'provides_dist' ,
269
+ 'obsoletes_dist' , 'requires_external' , 'classifiers' , 'description_content_type' ,
270
+ 'provides_extra' , 'dynamic' ,
258
271
)
259
272
model = python_models .PythonPackageContent
260
273
0 commit comments