Skip to content

Commit 3803fe8

Browse files
committed
Add missing python_version to serializer
1 parent b018bcf commit 3803fe8

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

pulp_python/app/serializers.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,12 @@ class PythonPackageContentSerializer(core_serializers.SingleArtifactContentUploa
196196
'(e.g. sdist, bdist_wheel, bdist_egg, etc)'),
197197
read_only=True,
198198
)
199+
python_version = serializers.CharField(
200+
help_text=_(
201+
'The tag that indicates which Python implementation or version the package requires.'
202+
),
203+
read_only=True,
204+
)
199205
sha256 = serializers.CharField(
200206
default='',
201207
help_text=_('The SHA256 digest of this package.'),
@@ -252,7 +258,7 @@ class Meta:
252258
'download_url', 'supported_platform', 'maintainer', 'maintainer_email',
253259
'obsoletes_dist', 'project_url', 'project_urls', 'provides_dist', 'requires_external',
254260
'requires_dist', 'requires_python', 'description_content_type',
255-
'filename', 'packagetype', 'sha256'
261+
'filename', 'packagetype', 'python_version', 'sha256'
256262
)
257263
model = python_models.PythonPackageContent
258264

pulp_python/tests/functional/api/test_repair.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,6 @@ def test_metadata_repair_command(
9696
}
9797
content = create_content_direct(python_file, data)
9898
for field, wrong_value in data.items():
99-
if field == "python_version":
100-
continue
10199
assert getattr(content, field) == wrong_value
102100

103101
move_to_repository(python_repo.pulp_href, [content.pulp_href])

0 commit comments

Comments
 (0)