Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES/1321.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added support for uploading packages with Core Metadata 2.5 via twine.
2 changes: 1 addition & 1 deletion pulp_python/app/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
PYPI_LAST_SERIAL = "X-PYPI-LAST-SERIAL"
"""TODO This serial constant is temporary until Python repositories implements serials"""
PYPI_SERIAL_CONSTANT = 1000000000
SUPPORTED_METADATA_VERSIONS = ("1.0", "1.1", "1.2", "2.0", "2.1", "2.2", "2.3", "2.4")
SUPPORTED_METADATA_VERSIONS = ("1.0", "1.1", "1.2", "2.0", "2.1", "2.2", "2.3", "2.4", "2.5")

SIMPLE_API_VERSION = "1.1"
PYPI_SIMPLE_V1_HTML = "application/vnd.pypi.simple.v1+html"
Expand Down
19 changes: 19 additions & 0 deletions pulp_python/tests/functional/api/test_crud_content_unit.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from urllib.parse import urljoin

import pytest
import requests
from pypi_simple import PyPISimple

from pulpcore.tests.functional.utils import PulpTaskError
Expand Down Expand Up @@ -182,6 +183,24 @@ def test_upload_metadata_24_spec(python_content_factory):
assert content.license_file == '["LICENSE"]'


@pytest.mark.parallel
def test_legacy_upload_metadata_25(python_empty_repo_distro, python_package_dist_directory):
"""Test that metadata_version 2.5 (PEP 794) is accepted via the legacy upload endpoint."""
flit_url = get_package_url("flit", "flit-4.0.2-py3-none-any.whl")
Comment thread
jobselko marked this conversation as resolved.
_, flit_file = python_package_dist_directory(flit_url)
_, distro = python_empty_repo_distro()
url = urljoin(distro.base_url, "legacy/")
sha256 = "7b0b0038cd91a7f04e2e287d958dc5f25e68ffeed0b93e613bd50aec99a0d9ca"
with open(flit_file, "rb") as f:
response = requests.post(
url,
data={"sha256_digest": sha256, "metadata_version": "2.5"},
files={"content": f},
auth=("admin", "password"),
)
assert response.status_code == 202


@pytest.mark.parallel
def test_package_creation_with_metadata(
pulp_content_url,
Expand Down
Loading