pulp-python 3.27.4__py3-none-any.whl → 3.27.6__py3-none-any.whl
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/app/__init__.py +1 -1
- pulp_python/app/tasks/sync.py +1 -1
- pulp_python/app/utils.py +2 -1
- pulp_python/tests/functional/api/test_attestations.py +48 -0
- pulp_python/tests/functional/api/test_pypi_apis.py +4 -3
- {pulp_python-3.27.4.dist-info → pulp_python-3.27.6.dist-info}/METADATA +1 -1
- {pulp_python-3.27.4.dist-info → pulp_python-3.27.6.dist-info}/RECORD +11 -11
- {pulp_python-3.27.4.dist-info → pulp_python-3.27.6.dist-info}/WHEEL +1 -1
- {pulp_python-3.27.4.dist-info → pulp_python-3.27.6.dist-info}/entry_points.txt +0 -0
- {pulp_python-3.27.4.dist-info → pulp_python-3.27.6.dist-info}/licenses/LICENSE +0 -0
- {pulp_python-3.27.4.dist-info → pulp_python-3.27.6.dist-info}/top_level.txt +0 -0
pulp_python/app/__init__.py
CHANGED
pulp_python/app/tasks/sync.py
CHANGED
|
@@ -10,7 +10,6 @@ from bandersnatch.master import Master
|
|
|
10
10
|
from bandersnatch.mirror import Mirror
|
|
11
11
|
from lxml.etree import LxmlError
|
|
12
12
|
from packaging.requirements import Requirement
|
|
13
|
-
from pypi_attestations import Provenance
|
|
14
13
|
from pypi_simple import IndexPage
|
|
15
14
|
from rest_framework import serializers
|
|
16
15
|
|
|
@@ -28,6 +27,7 @@ from pulp_python.app.models import (
|
|
|
28
27
|
PythonPackageContent,
|
|
29
28
|
PythonRemote,
|
|
30
29
|
)
|
|
30
|
+
from pulp_python.app.provenance import Provenance
|
|
31
31
|
from pulp_python.app.utils import PYPI_LAST_SERIAL, aget_remote_simple_page, parse_metadata
|
|
32
32
|
|
|
33
33
|
logger = logging.getLogger(__name__)
|
pulp_python/app/utils.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import hashlib
|
|
2
2
|
import json
|
|
3
3
|
import logging
|
|
4
|
+
import os
|
|
4
5
|
import re
|
|
5
6
|
import shutil
|
|
6
7
|
import tempfile
|
|
@@ -206,7 +207,7 @@ def get_project_metadata_from_file(filename):
|
|
|
206
207
|
else:
|
|
207
208
|
pyver = ""
|
|
208
209
|
regex = DIST_REGEXES[extensions[pkg_type_index]]
|
|
209
|
-
if bdist_name := regex.match(filename):
|
|
210
|
+
if bdist_name := regex.match(os.path.basename(filename)):
|
|
210
211
|
pyver = bdist_name.group("pyver") or ""
|
|
211
212
|
metadata.python_version = pyver
|
|
212
213
|
return metadata
|
|
@@ -154,6 +154,54 @@ def test_attestation_sync_upload(python_bindings, twine_package, download_python
|
|
|
154
154
|
assert att_bundle["publisher"]["kind"] == "Pulp User"
|
|
155
155
|
|
|
156
156
|
|
|
157
|
+
@pytest.mark.parallel
|
|
158
|
+
def test_sync_pulp_created_provenance(
|
|
159
|
+
domain_factory,
|
|
160
|
+
python_bindings,
|
|
161
|
+
twine_package,
|
|
162
|
+
python_repo_factory,
|
|
163
|
+
python_distribution_factory,
|
|
164
|
+
python_remote_factory,
|
|
165
|
+
python_repo_with_sync,
|
|
166
|
+
python_content_summary,
|
|
167
|
+
monitor_task,
|
|
168
|
+
):
|
|
169
|
+
"""Test syncing provenance across domains from a Pulp upload."""
|
|
170
|
+
source_domain = domain_factory()
|
|
171
|
+
attestations = get_attestations(twine_package.provenance_url)
|
|
172
|
+
source_repo = python_repo_factory(pulp_domain=source_domain.name)
|
|
173
|
+
body = {
|
|
174
|
+
"relative_path": twine_package.filename,
|
|
175
|
+
"file_url": twine_package.url,
|
|
176
|
+
"attestations": json.dumps(attestations),
|
|
177
|
+
"repository": source_repo.pulp_href,
|
|
178
|
+
}
|
|
179
|
+
task = python_bindings.ContentPackagesApi.create(pulp_domain=source_domain.name, **body).task
|
|
180
|
+
monitor_task(task)
|
|
181
|
+
|
|
182
|
+
source_distro = python_distribution_factory(
|
|
183
|
+
repository=source_repo, pulp_domain=source_domain.name
|
|
184
|
+
)
|
|
185
|
+
dest_domain = domain_factory()
|
|
186
|
+
remote = python_remote_factory(
|
|
187
|
+
url=source_distro.base_url,
|
|
188
|
+
provenance=True,
|
|
189
|
+
includes=[f"twine=={twine_package.version}"],
|
|
190
|
+
pulp_domain=dest_domain.name,
|
|
191
|
+
)
|
|
192
|
+
dest_repo = python_repo_with_sync(remote=remote, pulp_domain=dest_domain.name)
|
|
193
|
+
|
|
194
|
+
summary = python_content_summary(repository_version=dest_repo.latest_version_href)
|
|
195
|
+
assert summary.present["python.provenance"]["count"] == 1
|
|
196
|
+
|
|
197
|
+
provs = python_bindings.ContentProvenanceApi.list(
|
|
198
|
+
repository_version=dest_repo.latest_version_href,
|
|
199
|
+
pulp_domain=dest_domain.name,
|
|
200
|
+
)
|
|
201
|
+
assert provs.count == 1
|
|
202
|
+
assert provs.results[0].provenance["attestation_bundles"][0]["publisher"]["kind"] == "Pulp User"
|
|
203
|
+
|
|
204
|
+
|
|
157
205
|
def test_attestation_twine_upload(
|
|
158
206
|
pulpcore_bindings,
|
|
159
207
|
python_content_summary,
|
|
@@ -245,8 +245,9 @@ def test_simple_redirect_with_publications(
|
|
|
245
245
|
assert response.url == str(urljoin(pulp_content_url, f"{distro.base_path}/simple/"))
|
|
246
246
|
|
|
247
247
|
|
|
248
|
-
|
|
249
|
-
|
|
248
|
+
def test_pypi_json(
|
|
249
|
+
delete_orphans_pre, python_remote_factory, python_repo_with_sync, python_distribution_factory
|
|
250
|
+
):
|
|
250
251
|
"""Checks the data of `pypi/{package_name}/json` endpoint."""
|
|
251
252
|
remote = python_remote_factory(policy="immediate")
|
|
252
253
|
repo = python_repo_with_sync(remote)
|
|
@@ -260,8 +261,8 @@ def test_pypi_json(python_remote_factory, python_repo_with_sync, python_distribu
|
|
|
260
261
|
assert_pypi_json(response.json())
|
|
261
262
|
|
|
262
263
|
|
|
263
|
-
@pytest.mark.parallel
|
|
264
264
|
def test_pypi_json_content_app(
|
|
265
|
+
delete_orphans_pre,
|
|
265
266
|
python_remote_factory,
|
|
266
267
|
python_repo_with_sync,
|
|
267
268
|
python_publication_factory,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
pulp_python/__init__.py,sha256=GIuTLoBTc-07dSLJUh8xrZPRz8x-jJ61pfR0J1IjnzI,65
|
|
2
2
|
pulp_python/pytest_plugin.py,sha256=LNnLjOkeEu2X4gJi614bHVmbsHyEwooHYIeecr96Qy4,8606
|
|
3
|
-
pulp_python/app/__init__.py,sha256=
|
|
3
|
+
pulp_python/app/__init__.py,sha256=apCXN6djyith2YIcU2ObCVZQ07CSy6aw0XRNl2fnPIE,2490
|
|
4
4
|
pulp_python/app/global_access_conditions.py,sha256=MZJtyoVsr-4hRaty6mKDqh3caOHd5UKJjEWLV2crOLs,1080
|
|
5
5
|
pulp_python/app/modelresource.py,sha256=4SFAdqk6lozi_cZz4uqDIqhqPAZF-7l5jJwPn-xGZFs,1249
|
|
6
6
|
pulp_python/app/models.py,sha256=VVyr8LjAtHeHvY6klFeokwHNnY90qUuMchalm-2Gtjk,14056
|
|
@@ -9,7 +9,7 @@ pulp_python/app/replica.py,sha256=qiWRP7tM_v4yP_XLIQfumfGolru-Jt6ZA0KVb-9g2cA,18
|
|
|
9
9
|
pulp_python/app/serializers.py,sha256=8RpEeRSCLLD5rMd-Pz8fTXCglYmwDUWZNySGh6P3JuA,28669
|
|
10
10
|
pulp_python/app/settings.py,sha256=HXJK3rr0LVTOv1xBS5cZvVtz6j4SvFZl0PH3sLTcu2w,227
|
|
11
11
|
pulp_python/app/urls.py,sha256=NuNnyGc0lqa2HPtMpCpqJlMA0Hi4htOtZO_i8YPCc3k,1328
|
|
12
|
-
pulp_python/app/utils.py,sha256=
|
|
12
|
+
pulp_python/app/utils.py,sha256=oIFX4RaDcxPvlFdkTilyW_66MOdlKMz7Ke42lLlyNNs,27414
|
|
13
13
|
pulp_python/app/viewsets.py,sha256=R0vJSI-G9WBvaVPXdtBgTTlvddN_MFwoRUtWFwqBsaQ,28440
|
|
14
14
|
pulp_python/app/management/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
15
15
|
pulp_python/app/management/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -41,7 +41,7 @@ pulp_python/app/pypi/views.py,sha256=CmYBgrXBBSNcF0FSFWvOILJrexOUvH2M2FPO-Jiea6c
|
|
|
41
41
|
pulp_python/app/tasks/__init__.py,sha256=lTFpVvpDKbqv9RC0b2RYU8Bo6svDjrA-djt16pADFr8,284
|
|
42
42
|
pulp_python/app/tasks/publish.py,sha256=EMAfOZH8EFB9A-rzuxjrQG5FnvSXBVGT7dHQGCAUtrM,4334
|
|
43
43
|
pulp_python/app/tasks/repair.py,sha256=5InzdbjW8y3AC4Vj2PsNLm3wGGTr8D3LcfPw_WA2Fks,12257
|
|
44
|
-
pulp_python/app/tasks/sync.py,sha256=
|
|
44
|
+
pulp_python/app/tasks/sync.py,sha256=4IcAA0z2ewONfWZkx3srrvfV_-7jcQCTdWhUXCGn808,12875
|
|
45
45
|
pulp_python/app/tasks/upload.py,sha256=Pclsh6co5hBO6wdxZbGKBUSBV643nd9c2RXQO2Nkdik,5698
|
|
46
46
|
pulp_python/app/tasks/vulnerability_report.py,sha256=0cyxNb4048HFUdUlGBA6wYsg-hEMjSfE8mtw05Ct9BQ,1126
|
|
47
47
|
pulp_python/app/webserver_snippets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -52,7 +52,7 @@ pulp_python/tests/functional/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NM
|
|
|
52
52
|
pulp_python/tests/functional/constants.py,sha256=4e_zssE9G1bSNNJxYo7VgwvojUL_NocG5mUH996KBJs,13969
|
|
53
53
|
pulp_python/tests/functional/utils.py,sha256=GWnXrsQGZd0Ngewa_9yce58Qc3z7FbrlRvqao_8ZML0,5901
|
|
54
54
|
pulp_python/tests/functional/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
55
|
-
pulp_python/tests/functional/api/test_attestations.py,sha256=
|
|
55
|
+
pulp_python/tests/functional/api/test_attestations.py,sha256=tvRSsHyQVkoAp-Myoo_Y_7gz-HyNR8EA8G1yvik3dEg,10358
|
|
56
56
|
pulp_python/tests/functional/api/test_auto_publish.py,sha256=uCIt4LsO61oMk3bDs3LMQDJI8zkKqvY0b1uX16bTxzM,1747
|
|
57
57
|
pulp_python/tests/functional/api/test_consume_content.py,sha256=-7b6KOrIT3NLSUafeu1tzXEXRPddDbS5VeMHxMIy2n8,999
|
|
58
58
|
pulp_python/tests/functional/api/test_crud_content_unit.py,sha256=Pwjv3ytSfqBuoemuhJNIOEWdwzurPVN1XO3kDRlLFqY,8757
|
|
@@ -62,7 +62,7 @@ pulp_python/tests/functional/api/test_domains.py,sha256=uEA7dIBXaXah3WQ6g6xSIjdX
|
|
|
62
62
|
pulp_python/tests/functional/api/test_download_content.py,sha256=5IuaHXyLakPkjm5sLTxtTl7Dq0yl7N36HpObnIa0Sks,4950
|
|
63
63
|
pulp_python/tests/functional/api/test_export_import.py,sha256=rHns9wdaeP-vtfW_qoGHU9EVuJ4YuWE0-rjl_8otAgU,4530
|
|
64
64
|
pulp_python/tests/functional/api/test_full_mirror.py,sha256=eU5HzgBBFOnX1q4m8ELx-t-I3U4TWXL-LNrlc2BcWVc,12045
|
|
65
|
-
pulp_python/tests/functional/api/test_pypi_apis.py,sha256=
|
|
65
|
+
pulp_python/tests/functional/api/test_pypi_apis.py,sha256=TyehTS_Jo83yAb1d0l4XOWUJ-g4380UraCsKvhF_FWo,13224
|
|
66
66
|
pulp_python/tests/functional/api/test_pypi_simple_api.py,sha256=tOUl8WXgJkMoxGyLbA-WorCxIRKfGWM-27_dK_Jc0Q4,7171
|
|
67
67
|
pulp_python/tests/functional/api/test_rbac.py,sha256=-xNWqvKKU-v1uC6tCRGBK0aWaff25K9C-AfzQkdHhhI,10513
|
|
68
68
|
pulp_python/tests/functional/api/test_repair.py,sha256=4FR7jx_LA2K-pnRJXKkhq-1uUoWXST1leZ9XdyhGM2U,12909
|
|
@@ -73,9 +73,9 @@ pulp_python/tests/functional/assets/shelf-reader-0.1.tar.gz.publish.attestation,
|
|
|
73
73
|
pulp_python/tests/functional/assets/shelf_reader-0.1-py2-none-any.whl.publish.attestation,sha256=muTQ8dqYSSdx76DlaPjB1REcNIS-aak-Na0TkASxu8M,10426
|
|
74
74
|
pulp_python/tests/unit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
75
75
|
pulp_python/tests/unit/test_models.py,sha256=TBI0yKsrdbnJSPeBFfxSqhXK7zaNvR6qg5JehGH3Pds,229
|
|
76
|
-
pulp_python-3.27.
|
|
77
|
-
pulp_python-3.27.
|
|
78
|
-
pulp_python-3.27.
|
|
79
|
-
pulp_python-3.27.
|
|
80
|
-
pulp_python-3.27.
|
|
81
|
-
pulp_python-3.27.
|
|
76
|
+
pulp_python-3.27.6.dist-info/licenses/LICENSE,sha256=2ylvL381vKOhdO-w6zkrOxe9lLNBhRQpo9_0EbHC_HM,18046
|
|
77
|
+
pulp_python-3.27.6.dist-info/METADATA,sha256=zscAK-6TynP7UoRHvGn-qkYfhlcw9_AXvPLWZo3AHog,1743
|
|
78
|
+
pulp_python-3.27.6.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
|
|
79
|
+
pulp_python-3.27.6.dist-info/entry_points.txt,sha256=HvqLEXjw_dS5jqAwnE5JiRZFE6f-y5SRtitKLPml2To,115
|
|
80
|
+
pulp_python-3.27.6.dist-info/top_level.txt,sha256=X0hXgXc_bpbiKqVrkt8jD5_QEiQviKbHDwveQcOcJjo,12
|
|
81
|
+
pulp_python-3.27.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|