Skip to content

Commit 6a473a1

Browse files
committed
Update pkginfo library to support newer python packages
closes #689
1 parent 781b976 commit 6a473a1

File tree

4 files changed

+26
-0
lines changed

4 files changed

+26
-0
lines changed

CHANGES/689.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Support Python package metadata version 2.3
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Generated by Django 4.2.10 on 2024-06-28 04:12
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('python', '0013_add_rbac_permissions'),
10+
]
11+
12+
operations = [
13+
migrations.AddField(
14+
model_name='pythonpackagecontent',
15+
name='dynamic',
16+
field=models.TextField(default=''),
17+
preserve_default=False,
18+
),
19+
]

pulp_python/app/models.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,10 @@ class PythonPackageContent(Content):
145145

146146
PROTECTED_FROM_RECLAIM = False
147147

148+
# TODO: it appears we've set the default (usually empty-string) for each of these fields
149+
# manually in the migrations rather than setting them declaratively. That's not ideal.
150+
# At some point we should add proper default values and probably make some fields nullable.
151+
148152
TYPE = "python"
149153
repo_key_fields = ("filename",)
150154
# Required metadata
@@ -178,6 +182,7 @@ class PythonPackageContent(Content):
178182
classifiers = models.JSONField(default=list)
179183
project_urls = models.JSONField(default=dict)
180184
description_content_type = models.TextField()
185+
dynamic = models.TextField()
181186
# Pulp Domains
182187
_pulp_domain = models.ForeignKey("core.Domain", default=get_domain_pk, on_delete=models.PROTECT)
183188

pulp_python/app/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ def python_content_to_info(content):
220220
"keywords": content.keywords or "",
221221
"description": content.description or "",
222222
"description_content_type": content.description_content_type or "",
223+
"dynamic": content.dynamic or None,
223224
"bugtrack_url": None, # These two are basically never used
224225
"docs_url": None,
225226
"downloads": {"last_day": -1, "last_month": -1, "last_week": -1},

0 commit comments

Comments
 (0)