pulp-python 3.11.2__tar.gz → 3.11.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pulp-python-3.11.2 → pulp_python-3.11.4}/CHANGES.md +24 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/MANIFEST.in +1 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/PKG-INFO +16 -2
- {pulp-python-3.11.2 → pulp_python-3.11.4}/functest_requirements.txt +2 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/app/__init__.py +1 -1
- pulp_python-3.11.4/pulp_python/app/fields.py +12 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/app/models.py +5 -1
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/app/pypi/serializers.py +4 -3
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/app/pypi/views.py +2 -1
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/app/serializers.py +7 -6
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/tests/functional/api/test_crud_content_unit.py +28 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/tests/functional/api/test_download_content.py +30 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/tests/functional/api/test_pypi_apis.py +86 -50
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python.egg-info/PKG-INFO +16 -2
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python.egg-info/SOURCES.txt +1 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python.egg-info/requires.txt +2 -2
- pulp_python-3.11.4/pyproject.toml +74 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/requirements.txt +2 -2
- {pulp-python-3.11.2 → pulp_python-3.11.4}/setup.py +1 -1
- pulp-python-3.11.2/pyproject.toml +0 -29
- {pulp-python-3.11.2 → pulp_python-3.11.4}/COMMITMENT +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/COPYRIGHT +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/LICENSE +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/README.md +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/__init__.py +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/app/migrations/0001_initial.py +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/app/migrations/0002_pythonpackagecontent_python_version.py +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/app/migrations/0003_new_sync_filters.py +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/app/migrations/0004_DATA_swap_distribution_model.py +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/app/migrations/0005_pythonpackagecontent_sha256.py +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/app/migrations/0006_pythonrepository_autopublish.py +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/app/migrations/0007_pythonpackagecontent_mv-2-1.py +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/app/migrations/0008_pythonpackagecontent_unique_sha256.py +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/app/migrations/0009_pythondistribution_allow_uploads.py +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/app/migrations/0010_update_json_field.py +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/app/migrations/0011_alter_pythondistribution_distribution_ptr_and_more.py +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/app/migrations/__init__.py +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/app/modelresource.py +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/app/pypi/__init__.py +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/app/settings.py +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/app/tasks/__init__.py +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/app/tasks/publish.py +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/app/tasks/sync.py +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/app/tasks/upload.py +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/app/urls.py +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/app/utils.py +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/app/viewsets.py +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/app/webserver_snippets/__init__.py +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/app/webserver_snippets/apache.conf +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/app/webserver_snippets/nginx.conf +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/tests/__init__.py +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/tests/functional/__init__.py +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/tests/functional/api/__init__.py +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/tests/functional/api/test_auto_publish.py +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/tests/functional/api/test_consume_content.py +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/tests/functional/api/test_crud_publications.py +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/tests/functional/api/test_crud_remotes.py +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/tests/functional/api/test_export_import.py +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/tests/functional/api/test_full_mirror.py +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/tests/functional/api/test_sync.py +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/tests/functional/conftest.py +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/tests/functional/constants.py +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/tests/functional/utils.py +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/tests/unit/__init__.py +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/tests/unit/test_models.py +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/tests/upgrade/__init__.py +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/tests/upgrade/post/__init__.py +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/tests/upgrade/post/test_publish.py +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/tests/upgrade/pre/__init__.py +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/tests/upgrade/pre/test_publish.py +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python.egg-info/dependency_links.txt +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python.egg-info/entry_points.txt +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python.egg-info/top_level.txt +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/setup.cfg +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/test_requirements.txt +0 -0
- {pulp-python-3.11.2 → pulp_python-3.11.4}/unittest_requirements.txt +0 -0
|
@@ -8,6 +8,30 @@
|
|
|
8
8
|
|
|
9
9
|
[//]: # (towncrier release notes start)
|
|
10
10
|
|
|
11
|
+
## 3.11.4 (2025-02-20) {: #3.11.4 }
|
|
12
|
+
|
|
13
|
+
#### Bugfixes {: #3.11.4-bugfix }
|
|
14
|
+
|
|
15
|
+
- Fixed the JSONField specification so it doesn't break ruby bindings.
|
|
16
|
+
See context [here](https://github.com/pulp/pulp_rpm/issues/3639).
|
|
17
|
+
|
|
18
|
+
#### Misc {: #3.11.4-misc }
|
|
19
|
+
|
|
20
|
+
-
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
# ## 3.11.3 (2024-08-21) {: #3.11.3 }
|
|
25
|
+
|
|
26
|
+
#### Bugfixes {: #3.11.3-bugfix }
|
|
27
|
+
|
|
28
|
+
- Fixed uploads not supporting packages using metadata spec 2.3
|
|
29
|
+
[#682](https://github.com/pulp/pulp_python/issues/682)
|
|
30
|
+
- Fixed package name normalization issue preventing syncing packages with "." or "_" in their names.
|
|
31
|
+
[#716](https://github.com/pulp/pulp_python/issues/716)
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
11
35
|
## 3.11.2 (2024-06-27) {: #3.11.2 }
|
|
12
36
|
|
|
13
37
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: pulp-python
|
|
3
|
-
Version: 3.11.
|
|
3
|
+
Version: 3.11.4
|
|
4
4
|
Summary: pulp-python plugin for the Pulp Project
|
|
5
5
|
Home-page: https://www.pulpproject.org
|
|
6
6
|
Author: Pulp Project Developers
|
|
@@ -17,6 +17,20 @@ Classifier: Programming Language :: Python :: 3.9
|
|
|
17
17
|
Requires-Python: >=3.8
|
|
18
18
|
Description-Content-Type: text/markdown
|
|
19
19
|
License-File: LICENSE
|
|
20
|
+
Requires-Dist: pulpcore<3.55,>=3.28
|
|
21
|
+
Requires-Dist: pkginfo<1.13.0,>=1.12.0
|
|
22
|
+
Requires-Dist: bandersnatch<6.2,>=6.1
|
|
23
|
+
Requires-Dist: pypi-simple<1.0.0,>=0.9.0
|
|
24
|
+
Dynamic: author
|
|
25
|
+
Dynamic: author-email
|
|
26
|
+
Dynamic: classifier
|
|
27
|
+
Dynamic: description
|
|
28
|
+
Dynamic: description-content-type
|
|
29
|
+
Dynamic: home-page
|
|
30
|
+
Dynamic: license
|
|
31
|
+
Dynamic: requires-dist
|
|
32
|
+
Dynamic: requires-python
|
|
33
|
+
Dynamic: summary
|
|
20
34
|
|
|
21
35
|
# pulp_python
|
|
22
36
|
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
from drf_spectacular.utils import extend_schema_field
|
|
2
|
+
from drf_spectacular.types import OpenApiTypes
|
|
3
|
+
from rest_framework import serializers
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
@extend_schema_field(OpenApiTypes.OBJECT)
|
|
7
|
+
class JSONObjectField(serializers.JSONField):
|
|
8
|
+
"""A drf JSONField override to force openapi schema to use 'object' type.
|
|
9
|
+
|
|
10
|
+
Not strictly correct, but we relied on that for a long time.
|
|
11
|
+
See: https://github.com/tfranzel/drf-spectacular/issues/1095
|
|
12
|
+
"""
|
|
@@ -16,6 +16,7 @@ from pulpcore.plugin.responses import ArtifactResponse
|
|
|
16
16
|
|
|
17
17
|
from pathlib import PurePath
|
|
18
18
|
from .utils import (
|
|
19
|
+
canonicalize_name,
|
|
19
20
|
get_project_metadata_from_artifact,
|
|
20
21
|
parse_project_metadata,
|
|
21
22
|
python_content_to_json,
|
|
@@ -84,6 +85,8 @@ class PythonDistribution(Distribution):
|
|
|
84
85
|
).latest("pulp_created")
|
|
85
86
|
except ObjectDoesNotExist:
|
|
86
87
|
return None
|
|
88
|
+
if len(path.parts) == 2:
|
|
89
|
+
path = PurePath(f"simple/{canonicalize_name(path.parts[1])}")
|
|
87
90
|
rel_path = f"{path}/index.html"
|
|
88
91
|
try:
|
|
89
92
|
ca = (
|
|
@@ -100,8 +103,9 @@ class PythonDistribution(Distribution):
|
|
|
100
103
|
return ArtifactResponse(ca.artifact, headers=headers)
|
|
101
104
|
|
|
102
105
|
if name:
|
|
106
|
+
normalized = canonicalize_name(name)
|
|
103
107
|
package_content = PythonPackageContent.objects.filter(
|
|
104
|
-
pk__in=self.publication.repository_version.content,
|
|
108
|
+
pk__in=self.publication.repository_version.content, name__normalize=normalized
|
|
105
109
|
)
|
|
106
110
|
# TODO Change this value to the Repo's serial value when implemented
|
|
107
111
|
headers = {PYPI_LAST_SERIAL: str(PYPI_SERIAL_CONSTANT)}
|
|
@@ -3,6 +3,7 @@ from gettext import gettext as _
|
|
|
3
3
|
|
|
4
4
|
from rest_framework import serializers
|
|
5
5
|
from pulp_python.app.utils import DIST_EXTENSIONS
|
|
6
|
+
from pulp_python.app import fields
|
|
6
7
|
from pulpcore.plugin.models import Artifact
|
|
7
8
|
from django.db.utils import IntegrityError
|
|
8
9
|
|
|
@@ -27,9 +28,9 @@ class PackageMetadataSerializer(serializers.Serializer):
|
|
|
27
28
|
"""
|
|
28
29
|
|
|
29
30
|
last_serial = serializers.IntegerField(help_text=_("Cache value from last PyPI sync"))
|
|
30
|
-
info =
|
|
31
|
-
releases =
|
|
32
|
-
urls =
|
|
31
|
+
info = fields.JSONObjectField(help_text=_("Core metadata of the package"))
|
|
32
|
+
releases = fields.JSONObjectField(help_text=_("List of all the releases of the package"))
|
|
33
|
+
urls = fields.JSONObjectField()
|
|
33
34
|
|
|
34
35
|
|
|
35
36
|
class PackageUploadSerializer(serializers.Serializer):
|
|
@@ -278,7 +278,8 @@ class MetadataView(ViewSet, PyPIMixin):
|
|
|
278
278
|
elif meta_path.match("*/json"):
|
|
279
279
|
name = meta_path.parts[0]
|
|
280
280
|
if name:
|
|
281
|
-
|
|
281
|
+
normalized = canonicalize_name(name)
|
|
282
|
+
package_content = content.filter(name__normalize=normalized)
|
|
282
283
|
# TODO Change this value to the Repo's serial value when implemented
|
|
283
284
|
headers = {PYPI_LAST_SERIAL: str(PYPI_SERIAL_CONSTANT)}
|
|
284
285
|
json_body = python_content_to_json(path, package_content, version=version)
|
|
@@ -7,6 +7,7 @@ from pulpcore.plugin import models as core_models
|
|
|
7
7
|
from pulpcore.plugin import serializers as core_serializers
|
|
8
8
|
|
|
9
9
|
from pulp_python.app import models as python_models
|
|
10
|
+
from pulp_python.app import fields
|
|
10
11
|
from pulp_python.app.utils import get_project_metadata_from_artifact, parse_project_metadata
|
|
11
12
|
|
|
12
13
|
|
|
@@ -154,7 +155,7 @@ class PythonPackageContentSerializer(core_serializers.SingleArtifactContentUploa
|
|
|
154
155
|
required=False, allow_blank=True,
|
|
155
156
|
help_text=_('A browsable URL for the project and a label for it, separated by a comma.')
|
|
156
157
|
)
|
|
157
|
-
project_urls =
|
|
158
|
+
project_urls = fields.JSONObjectField(
|
|
158
159
|
required=False, default=dict,
|
|
159
160
|
help_text=_('A dictionary of labels and URLs for the project.')
|
|
160
161
|
)
|
|
@@ -167,28 +168,28 @@ class PythonPackageContentSerializer(core_serializers.SingleArtifactContentUploa
|
|
|
167
168
|
required=False, allow_blank=True,
|
|
168
169
|
help_text=_('Field to specify the OS and CPU for which the binary package was compiled. ')
|
|
169
170
|
)
|
|
170
|
-
requires_dist =
|
|
171
|
+
requires_dist = fields.JSONObjectField(
|
|
171
172
|
required=False, default=list,
|
|
172
173
|
help_text=_('A JSON list containing names of some other distutils project '
|
|
173
174
|
'required by this distribution.')
|
|
174
175
|
)
|
|
175
|
-
provides_dist =
|
|
176
|
+
provides_dist = fields.JSONObjectField(
|
|
176
177
|
required=False, default=list,
|
|
177
178
|
help_text=_('A JSON list containing names of a Distutils project which is contained'
|
|
178
179
|
' within this distribution.')
|
|
179
180
|
)
|
|
180
|
-
obsoletes_dist =
|
|
181
|
+
obsoletes_dist = fields.JSONObjectField(
|
|
181
182
|
required=False, default=list,
|
|
182
183
|
help_text=_('A JSON list containing names of a distutils project\'s distribution which '
|
|
183
184
|
'this distribution renders obsolete, meaning that the two projects should not '
|
|
184
185
|
'be installed at the same time.')
|
|
185
186
|
)
|
|
186
|
-
requires_external =
|
|
187
|
+
requires_external = fields.JSONObjectField(
|
|
187
188
|
required=False, default=list,
|
|
188
189
|
help_text=_('A JSON list containing some dependency in the system that the distribution '
|
|
189
190
|
'is to be used.')
|
|
190
191
|
)
|
|
191
|
-
classifiers =
|
|
192
|
+
classifiers = fields.JSONObjectField(
|
|
192
193
|
required=False, default=list,
|
|
193
194
|
help_text=_('A JSON list containing classification values for a Python package.')
|
|
194
195
|
)
|
{pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/tests/functional/api/test_crud_content_unit.py
RENAMED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# coding=utf-8
|
|
2
2
|
"""Tests that perform actions over content unit."""
|
|
3
|
+
import pytest
|
|
3
4
|
from pulp_smash.pulp3.bindings import delete_orphans, monitor_task, PulpTaskError
|
|
4
5
|
|
|
5
6
|
from pulp_python.tests.functional.utils import (
|
|
@@ -12,6 +13,7 @@ from pulp_python.tests.functional.utils import (
|
|
|
12
13
|
from pulp_python.tests.functional.utils import set_up_module as setUpModule # noqa:F401
|
|
13
14
|
from tempfile import NamedTemporaryFile
|
|
14
15
|
from urllib.parse import urljoin
|
|
16
|
+
from pypi_simple import PyPISimple
|
|
15
17
|
|
|
16
18
|
from pulp_smash.utils import http_get
|
|
17
19
|
from pulp_python.tests.functional.constants import (
|
|
@@ -227,3 +229,29 @@ class ContentUnitTestCase(TestCaseUsingBindings, TestHelpersMixin):
|
|
|
227
229
|
for k, v in expected.items():
|
|
228
230
|
with self.subTest(key=k):
|
|
229
231
|
self.assertEqual(content_unit[k], v)
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
@pytest.mark.parallel
|
|
235
|
+
def test_upload_metadata_23_spec(python_content_factory):
|
|
236
|
+
"""Test that packages using metadata spec 2.3 can be uploaded to pulp."""
|
|
237
|
+
filename = "urllib3-2.2.2-py3-none-any.whl"
|
|
238
|
+
with PyPISimple() as client:
|
|
239
|
+
page = client.get_project_page("urllib3")
|
|
240
|
+
for package in page.packages:
|
|
241
|
+
if package.filename == filename:
|
|
242
|
+
content = python_content_factory(filename, url=package.url)
|
|
243
|
+
assert content.metadata_version == "2.3"
|
|
244
|
+
break
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
@pytest.mark.parallel
|
|
248
|
+
def test_upload_metadata_24_spec(python_content_factory):
|
|
249
|
+
"""Test that packages using metadata spec 2.4 can be uploaded to pulp."""
|
|
250
|
+
filename = "urllib3-2.3.0-py3-none-any.whl"
|
|
251
|
+
with PyPISimple() as client:
|
|
252
|
+
page = client.get_project_page("urllib3")
|
|
253
|
+
for package in page.packages:
|
|
254
|
+
if package.filename == filename:
|
|
255
|
+
content = python_content_factory(filename, url=package.url)
|
|
256
|
+
assert content.metadata_version == "2.4"
|
|
257
|
+
break
|
{pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/tests/functional/api/test_download_content.py
RENAMED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# coding=utf-8
|
|
2
2
|
"""Tests that verify download of content served by Pulp."""
|
|
3
|
+
import pytest
|
|
3
4
|
import hashlib
|
|
4
5
|
from random import choice
|
|
5
6
|
from urllib.parse import urljoin
|
|
@@ -149,3 +150,32 @@ class PublishPyPIJSON(TestCaseUsingBindings, TestHelpersMixin):
|
|
|
149
150
|
|
|
150
151
|
repo3 = self._create_repo_and_sync_with_remote(remote)
|
|
151
152
|
self.assertEqual(get_content_summary(repo3.to_dict()), PYTHON_MD_FIXTURE_SUMMARY)
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
@pytest.mark.parallel
|
|
156
|
+
def test_pulp2pulp_sync_with_oddities(
|
|
157
|
+
python_repo_with_sync,
|
|
158
|
+
python_remote_factory,
|
|
159
|
+
python_publication_factory,
|
|
160
|
+
python_distribution_factory,
|
|
161
|
+
python_content_summary,
|
|
162
|
+
):
|
|
163
|
+
"""Test that Pulp can handle syncing packages with wierd names."""
|
|
164
|
+
remote = python_remote_factory(includes=["oslo.utils"], url="https://pypi.org")
|
|
165
|
+
repo = python_repo_with_sync(remote)
|
|
166
|
+
distro = python_distribution_factory(repository=repo.pulp_href)
|
|
167
|
+
summary = python_content_summary(repository_version=repo.latest_version_href)
|
|
168
|
+
# Test pulp 2 pulp full sync w/ live pypi apis
|
|
169
|
+
remote2 = python_remote_factory(includes=[], url=distro.base_url)
|
|
170
|
+
repo2 = python_repo_with_sync(remote2)
|
|
171
|
+
summary2 = python_content_summary(repository_version=repo2.latest_version_href)
|
|
172
|
+
assert summary2.present["python.python"]["count"] > 0
|
|
173
|
+
assert summary.present["python.python"]["count"] == summary2.present["python.python"]["count"]
|
|
174
|
+
# Test w/ publication
|
|
175
|
+
pub = python_publication_factory(repository=repo)
|
|
176
|
+
distro2 = python_distribution_factory(publication=pub.pulp_href)
|
|
177
|
+
remote3 = python_remote_factory(includes=[], url=distro2.base_url)
|
|
178
|
+
repo3 = python_repo_with_sync(remote3)
|
|
179
|
+
summary3 = python_content_summary(repository_version=repo3.latest_version_href)
|
|
180
|
+
assert summary3.present["python.python"]["count"] > 0
|
|
181
|
+
assert summary.present["python.python"]["count"] == summary3.present["python.python"]["count"]
|
{pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/tests/functional/api/test_pypi_apis.py
RENAMED
|
@@ -3,10 +3,11 @@ import os
|
|
|
3
3
|
import requests
|
|
4
4
|
import subprocess
|
|
5
5
|
import tempfile
|
|
6
|
+
import pytest
|
|
6
7
|
|
|
7
8
|
from urllib.parse import urljoin
|
|
8
9
|
|
|
9
|
-
from pulp_smash.pulp3.bindings import monitor_task
|
|
10
|
+
from pulp_smash.pulp3.bindings import monitor_task
|
|
10
11
|
from pulp_smash.pulp3.utils import get_added_content_summary, get_content_summary
|
|
11
12
|
from pulp_python.tests.functional.constants import (
|
|
12
13
|
PYTHON_CONTENT_NAME,
|
|
@@ -40,6 +41,32 @@ HOST = client.configuration.host
|
|
|
40
41
|
PYPI_HOST = urljoin(HOST, PULP_PYPI_BASE_URL)
|
|
41
42
|
|
|
42
43
|
|
|
44
|
+
@pytest.fixture
|
|
45
|
+
def python_empty_repo_distro(python_repo_factory, python_distribution_factory):
|
|
46
|
+
"""Returns an empty repo with and distribution serving it."""
|
|
47
|
+
def _generate_empty_repo_distro(repo_body=None, distro_body=None):
|
|
48
|
+
repo_body = repo_body or {}
|
|
49
|
+
distro_body = distro_body or {}
|
|
50
|
+
repo = python_repo_factory(**repo_body)
|
|
51
|
+
distro = python_distribution_factory(repository=repo.pulp_href, **distro_body)
|
|
52
|
+
return repo, distro
|
|
53
|
+
|
|
54
|
+
yield _generate_empty_repo_distro
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
@pytest.fixture(scope="module")
|
|
58
|
+
def python_package_dist_directory(tmp_path_factory, http_get):
|
|
59
|
+
"""Creates a temp dir to hold package distros for uploading."""
|
|
60
|
+
dist_dir = tmp_path_factory.mktemp("dist")
|
|
61
|
+
egg_file = dist_dir / PYTHON_EGG_FILENAME
|
|
62
|
+
wheel_file = dist_dir / PYTHON_WHEEL_FILENAME
|
|
63
|
+
with open(egg_file, "wb") as f:
|
|
64
|
+
f.write(http_get(PYTHON_EGG_URL))
|
|
65
|
+
with open(wheel_file, "wb") as f:
|
|
66
|
+
f.write(http_get(PYTHON_WHEEL_URL))
|
|
67
|
+
yield dist_dir, egg_file, wheel_file
|
|
68
|
+
|
|
69
|
+
|
|
43
70
|
class PyPISummaryTestCase(TestCaseUsingBindings, TestHelpersMixin):
|
|
44
71
|
"""Tests the summary response of the base url of an index."""
|
|
45
72
|
|
|
@@ -162,18 +189,51 @@ class PyPIPackageUpload(TestCaseUsingBindings, TestHelpersMixin):
|
|
|
162
189
|
content = get_added_content_summary(repo, f"{repo.versions_href}1/")
|
|
163
190
|
self.assertDictEqual({PYTHON_CONTENT_NAME: 1}, content)
|
|
164
191
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
192
|
+
|
|
193
|
+
@pytest.mark.parallel
|
|
194
|
+
def test_twine_upload(
|
|
195
|
+
pulpcore_bindings,
|
|
196
|
+
python_content_summary,
|
|
197
|
+
python_empty_repo_distro,
|
|
198
|
+
python_package_dist_directory,
|
|
199
|
+
monitor_task,
|
|
200
|
+
):
|
|
201
|
+
"""Tests that packages can be properly uploaded through Twine."""
|
|
202
|
+
repo, distro = python_empty_repo_distro()
|
|
203
|
+
url = urljoin(distro.base_url, "legacy/")
|
|
204
|
+
dist_dir, _, _ = python_package_dist_directory
|
|
205
|
+
username, password = "admin", "password"
|
|
206
|
+
subprocess.run(
|
|
207
|
+
(
|
|
208
|
+
"twine",
|
|
209
|
+
"upload",
|
|
210
|
+
"--repository-url",
|
|
211
|
+
url,
|
|
212
|
+
dist_dir / "*",
|
|
213
|
+
"-u",
|
|
214
|
+
username,
|
|
215
|
+
"-p",
|
|
216
|
+
password,
|
|
217
|
+
),
|
|
218
|
+
capture_output=True,
|
|
219
|
+
check=True,
|
|
220
|
+
)
|
|
221
|
+
tasks = pulpcore_bindings.TasksApi.list(reserved_resources=repo.pulp_href).results
|
|
222
|
+
for task in reversed(tasks):
|
|
223
|
+
t = monitor_task(task.pulp_href)
|
|
224
|
+
repo_ver_href = t.created_resources[-1]
|
|
225
|
+
summary = python_content_summary(repository_version=repo_ver_href)
|
|
226
|
+
assert summary.present["python.python"]["count"] == 2
|
|
227
|
+
|
|
228
|
+
# Test re-uploading same packages gives error
|
|
229
|
+
with pytest.raises(subprocess.CalledProcessError):
|
|
170
230
|
subprocess.run(
|
|
171
231
|
(
|
|
172
232
|
"twine",
|
|
173
233
|
"upload",
|
|
174
234
|
"--repository-url",
|
|
175
235
|
url,
|
|
176
|
-
|
|
236
|
+
dist_dir / "*",
|
|
177
237
|
"-u",
|
|
178
238
|
username,
|
|
179
239
|
"-p",
|
|
@@ -182,50 +242,26 @@ class PyPIPackageUpload(TestCaseUsingBindings, TestHelpersMixin):
|
|
|
182
242
|
capture_output=True,
|
|
183
243
|
check=True,
|
|
184
244
|
)
|
|
185
|
-
tasks = task_api.list(reserved_resources_record=[repo.pulp_href]).results
|
|
186
|
-
for task in reversed(tasks):
|
|
187
|
-
t = monitor_task(task.pulp_href)
|
|
188
|
-
repo_ver_href = t.created_resources[-1]
|
|
189
|
-
content = get_content_summary(repo, f"{repo_ver_href}")
|
|
190
|
-
self.assertDictEqual({PYTHON_CONTENT_NAME: 2}, content)
|
|
191
245
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
output = subprocess.run(
|
|
212
|
-
(
|
|
213
|
-
"twine",
|
|
214
|
-
"upload",
|
|
215
|
-
"--repository-url",
|
|
216
|
-
url,
|
|
217
|
-
self.dists_dir.name + "/*",
|
|
218
|
-
"-u",
|
|
219
|
-
username,
|
|
220
|
-
"-p",
|
|
221
|
-
password,
|
|
222
|
-
"--skip-existing",
|
|
223
|
-
),
|
|
224
|
-
capture_output=True,
|
|
225
|
-
check=True,
|
|
226
|
-
text=True
|
|
227
|
-
)
|
|
228
|
-
self.assertEqual(output.stdout.count("Skipping"), 2)
|
|
246
|
+
# Test re-uploading same packages with --skip-existing works
|
|
247
|
+
output = subprocess.run(
|
|
248
|
+
(
|
|
249
|
+
"twine",
|
|
250
|
+
"upload",
|
|
251
|
+
"--repository-url",
|
|
252
|
+
url,
|
|
253
|
+
dist_dir / "*",
|
|
254
|
+
"-u",
|
|
255
|
+
username,
|
|
256
|
+
"-p",
|
|
257
|
+
password,
|
|
258
|
+
"--skip-existing",
|
|
259
|
+
),
|
|
260
|
+
capture_output=True,
|
|
261
|
+
check=True,
|
|
262
|
+
text=True
|
|
263
|
+
)
|
|
264
|
+
assert output.stdout.count("Skipping") == 2
|
|
229
265
|
|
|
230
266
|
|
|
231
267
|
class PyPISimpleApi(TestCaseUsingBindings, TestHelpersMixin):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: pulp-python
|
|
3
|
-
Version: 3.11.
|
|
3
|
+
Version: 3.11.4
|
|
4
4
|
Summary: pulp-python plugin for the Pulp Project
|
|
5
5
|
Home-page: https://www.pulpproject.org
|
|
6
6
|
Author: Pulp Project Developers
|
|
@@ -17,6 +17,20 @@ Classifier: Programming Language :: Python :: 3.9
|
|
|
17
17
|
Requires-Python: >=3.8
|
|
18
18
|
Description-Content-Type: text/markdown
|
|
19
19
|
License-File: LICENSE
|
|
20
|
+
Requires-Dist: pulpcore<3.55,>=3.28
|
|
21
|
+
Requires-Dist: pkginfo<1.13.0,>=1.12.0
|
|
22
|
+
Requires-Dist: bandersnatch<6.2,>=6.1
|
|
23
|
+
Requires-Dist: pypi-simple<1.0.0,>=0.9.0
|
|
24
|
+
Dynamic: author
|
|
25
|
+
Dynamic: author-email
|
|
26
|
+
Dynamic: classifier
|
|
27
|
+
Dynamic: description
|
|
28
|
+
Dynamic: description-content-type
|
|
29
|
+
Dynamic: home-page
|
|
30
|
+
Dynamic: license
|
|
31
|
+
Dynamic: requires-dist
|
|
32
|
+
Dynamic: requires-python
|
|
33
|
+
Dynamic: summary
|
|
20
34
|
|
|
21
35
|
# pulp_python
|
|
22
36
|
|
|
@@ -18,6 +18,7 @@ pulp_python.egg-info/entry_points.txt
|
|
|
18
18
|
pulp_python.egg-info/requires.txt
|
|
19
19
|
pulp_python.egg-info/top_level.txt
|
|
20
20
|
pulp_python/app/__init__.py
|
|
21
|
+
pulp_python/app/fields.py
|
|
21
22
|
pulp_python/app/modelresource.py
|
|
22
23
|
pulp_python/app/models.py
|
|
23
24
|
pulp_python/app/serializers.py
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
[tool.towncrier]
|
|
2
|
+
package = "pulp_python"
|
|
3
|
+
filename = "CHANGES.md"
|
|
4
|
+
directory = "CHANGES/"
|
|
5
|
+
title_format = "## {version} ({project_date}) {{: #{version} }}"
|
|
6
|
+
template = "CHANGES/.TEMPLATE.md"
|
|
7
|
+
issue_format = "[#{issue}](https://github.com/pulp/pulp_python/issues/{issue})"
|
|
8
|
+
start_string = "[//]: # (towncrier release notes start)\n"
|
|
9
|
+
underlines = ["", "", ""]
|
|
10
|
+
|
|
11
|
+
[tool.check-manifest]
|
|
12
|
+
ignore = [
|
|
13
|
+
".bumpversion.cfg",
|
|
14
|
+
".pep8speaks.yml",
|
|
15
|
+
"CHANGES/**",
|
|
16
|
+
"CONTRIBUTING.rst",
|
|
17
|
+
"HISTORY.rst",
|
|
18
|
+
"dev_requirements.txt",
|
|
19
|
+
"doc_requirements.txt",
|
|
20
|
+
"docs/**",
|
|
21
|
+
"template_config.yml",
|
|
22
|
+
".travis/**",
|
|
23
|
+
".travis.yml",
|
|
24
|
+
"shelf_reader-0.1-py2-none-any.whl",
|
|
25
|
+
".github/**",
|
|
26
|
+
".ci/**",
|
|
27
|
+
"lint_requirements.txt",
|
|
28
|
+
".flake8",
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
[tool.bumpversion]
|
|
32
|
+
# This section is managed by the plugin template. Do not edit manually.
|
|
33
|
+
|
|
34
|
+
current_version = "3.11.4"
|
|
35
|
+
commit = false
|
|
36
|
+
tag = false
|
|
37
|
+
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<alpha>0a)?(?P<patch>\\d+)(\\.(?P<release>[a-z]+))?"
|
|
38
|
+
serialize = [
|
|
39
|
+
"{major}.{minor}.{patch}.{release}",
|
|
40
|
+
"{major}.{minor}.{patch}",
|
|
41
|
+
"{major}.{minor}.{alpha}{patch}.{release}",
|
|
42
|
+
"{major}.{minor}.{alpha}{patch}",
|
|
43
|
+
]
|
|
44
|
+
|
|
45
|
+
[tool.bumpversion.parts.alpha]
|
|
46
|
+
# This section is managed by the plugin template. Do not edit manually.
|
|
47
|
+
|
|
48
|
+
# This is sort of a hack. In PEP440 prerelease markers work quite differently.
|
|
49
|
+
# But this fits best with the way we have been doing release versions.
|
|
50
|
+
optional_value = "final"
|
|
51
|
+
values = [
|
|
52
|
+
"0a",
|
|
53
|
+
"final",
|
|
54
|
+
]
|
|
55
|
+
independent = true
|
|
56
|
+
|
|
57
|
+
[tool.bumpversion.parts.release]
|
|
58
|
+
# This section is managed by the plugin template. Do not edit manually.
|
|
59
|
+
|
|
60
|
+
optional_value = "prod"
|
|
61
|
+
values = [
|
|
62
|
+
"dev",
|
|
63
|
+
"prod",
|
|
64
|
+
]
|
|
65
|
+
|
|
66
|
+
[[tool.bumpversion.files]]
|
|
67
|
+
# This section is managed by the plugin template. Do not edit manually.
|
|
68
|
+
|
|
69
|
+
filename = "./pulp_python/app/__init__.py"
|
|
70
|
+
search = "version = \"{current_version}\""
|
|
71
|
+
replace = "version = \"{new_version}\""
|
|
72
|
+
|
|
73
|
+
[[tool.bumpversion.files]]
|
|
74
|
+
filename = "./setup.py"
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
[tool.towncrier]
|
|
2
|
-
package = "pulp_python"
|
|
3
|
-
filename = "CHANGES.md"
|
|
4
|
-
directory = "CHANGES/"
|
|
5
|
-
title_format = "## {version} ({project_date}) {{: #{version} }}"
|
|
6
|
-
template = "CHANGES/.TEMPLATE.md"
|
|
7
|
-
issue_format = "[#{issue}](https://github.com/pulp/pulp_python/issues/{issue})"
|
|
8
|
-
start_string = "[//]: # (towncrier release notes start)\n"
|
|
9
|
-
underlines = ["", "", ""]
|
|
10
|
-
|
|
11
|
-
[tool.check-manifest]
|
|
12
|
-
ignore = [
|
|
13
|
-
".bumpversion.cfg",
|
|
14
|
-
".pep8speaks.yml",
|
|
15
|
-
"CHANGES/**",
|
|
16
|
-
"CONTRIBUTING.rst",
|
|
17
|
-
"HISTORY.rst",
|
|
18
|
-
"dev_requirements.txt",
|
|
19
|
-
"doc_requirements.txt",
|
|
20
|
-
"docs/**",
|
|
21
|
-
"template_config.yml",
|
|
22
|
-
".travis/**",
|
|
23
|
-
".travis.yml",
|
|
24
|
-
"shelf_reader-0.1-py2-none-any.whl",
|
|
25
|
-
".github/**",
|
|
26
|
-
".ci/**",
|
|
27
|
-
"lint_requirements.txt",
|
|
28
|
-
".flake8",
|
|
29
|
-
]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/app/migrations/0003_new_sync_filters.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/app/migrations/0010_update_json_field.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/tests/functional/api/test_auto_publish.py
RENAMED
|
File without changes
|
{pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/tests/functional/api/test_consume_content.py
RENAMED
|
File without changes
|
{pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/tests/functional/api/test_crud_publications.py
RENAMED
|
File without changes
|
{pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/tests/functional/api/test_crud_remotes.py
RENAMED
|
File without changes
|
{pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/tests/functional/api/test_export_import.py
RENAMED
|
File without changes
|
{pulp-python-3.11.2 → pulp_python-3.11.4}/pulp_python/tests/functional/api/test_full_mirror.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|