Skip to content

Commit 2e6f129

Browse files
committed
Fix upload not supporting package metadata 2.3
fixes: pulp#682 (cherry picked from commit 781b976)
1 parent 944cc9d commit 2e6f129

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

CHANGES/682.bugfix

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed uploads not supporting packages using metadata spec 2.3

pulp_python/tests/functional/api/test_crud_content_unit.py

+14
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# coding=utf-8
22
"""Tests that perform actions over content unit."""
3+
import pytest
34
from pulp_smash.pulp3.bindings import delete_orphans, monitor_task, PulpTaskError
45

56
from pulp_python.tests.functional.utils import (
@@ -12,6 +13,7 @@
1213
from pulp_python.tests.functional.utils import set_up_module as setUpModule # noqa:F401
1314
from tempfile import NamedTemporaryFile
1415
from urllib.parse import urljoin
16+
from pypi_simple import PyPISimple
1517

1618
from pulp_smash.utils import http_get
1719
from pulp_python.tests.functional.constants import (
@@ -227,3 +229,15 @@ def check_package_data(self, content_unit, expected=PYTHON_PACKAGE_DATA):
227229
for k, v in expected.items():
228230
with self.subTest(key=k):
229231
self.assertEqual(content_unit[k], v)
232+
233+
@pytest.mark.parallel
234+
def test_upload_metadata_23_spec(python_content_factory):
235+
"""Test that packages using metadata spec 2.3 can be uploaded to pulp."""
236+
filename = "urllib3-2.2.2-py3-none-any.whl"
237+
with PyPISimple() as client:
238+
page = client.get_project_page("urllib3")
239+
for package in page.packages:
240+
if package.filename == filename:
241+
content = python_content_factory(filename, url=package.url)
242+
assert content.metadata_version == "2.3"
243+
break

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
pulpcore>=3.28,<3.55
2-
pkginfo>=1.8.2,<1.9.7
2+
pkginfo>=1.10.0,<1.12.0 # Twine has <1.11 in their requirements
33
bandersnatch>=6.1,<6.2
44
pypi-simple>=0.9.0,<1.0.0

0 commit comments

Comments
 (0)