Skip to content

Commit

Permalink
Fix upload not supporting package metadata 2.3
Browse files Browse the repository at this point in the history
fixes: pulp#682
(cherry picked from commit 781b976)
  • Loading branch information
gerrod3 committed Aug 13, 2024
1 parent 944cc9d commit 6eccadc
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES/682.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed uploads not supporting packages using metadata spec 2.3
15 changes: 15 additions & 0 deletions pulp_python/tests/functional/api/test_crud_content_unit.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# coding=utf-8
"""Tests that perform actions over content unit."""
import pytest
from pulp_smash.pulp3.bindings import delete_orphans, monitor_task, PulpTaskError

from pulp_python.tests.functional.utils import (
Expand All @@ -12,6 +13,7 @@
from pulp_python.tests.functional.utils import set_up_module as setUpModule # noqa:F401
from tempfile import NamedTemporaryFile
from urllib.parse import urljoin
from pypi_simple import PyPISimple

from pulp_smash.utils import http_get
from pulp_python.tests.functional.constants import (
Expand Down Expand Up @@ -227,3 +229,16 @@ def check_package_data(self, content_unit, expected=PYTHON_PACKAGE_DATA):
for k, v in expected.items():
with self.subTest(key=k):
self.assertEqual(content_unit[k], v)


@pytest.mark.parallel
def test_upload_metadata_23_spec(python_content_factory):
"""Test that packages using metadata spec 2.3 can be uploaded to pulp."""
filename = "urllib3-2.2.2-py3-none-any.whl"
with PyPISimple() as client:
page = client.get_project_page("urllib3")
for package in page.packages:
if package.filename == filename:
content = python_content_factory(filename, url=package.url)
assert content.metadata_version == "2.3"
break
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pulpcore>=3.28,<3.55
pkginfo>=1.8.2,<1.9.7
pkginfo>=1.10.0,<1.12.0 # Twine has <1.11 in their requirements
bandersnatch>=6.1,<6.2
pypi-simple>=0.9.0,<1.0.0

0 comments on commit 6eccadc

Please sign in to comment.