@@ -108,11 +108,6 @@ class PythonPackageContentSerializer(core_serializers.SingleArtifactContentUploa
108108 required = False , allow_blank = True ,
109109 help_text = _ ('A longer description of the package that can run to several paragraphs.' )
110110 )
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- )
116111 keywords = serializers .CharField (
117112 required = False , allow_blank = True ,
118113 help_text = _ ('Additional keywords to be used to assist searching for the '
@@ -195,6 +190,23 @@ class PythonPackageContentSerializer(core_serializers.SingleArtifactContentUploa
195190 required = False , default = list ,
196191 help_text = _ ('A JSON list containing classification values for a Python package.' )
197192 )
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+ )
198210
199211 def deferred_validate (self , data ):
200212 """
@@ -251,10 +263,11 @@ def retrieve(self, validated_data):
251263 class Meta :
252264 fields = core_serializers .SingleArtifactContentUploadSerializer .Meta .fields + (
253265 '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' ,
258271 )
259272 model = python_models .PythonPackageContent
260273
0 commit comments