pulp-python 3.12.9__tar.gz → 3.12.10__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.
Files changed (78) hide show
  1. {pulp_python-3.12.9 → pulp_python-3.12.10}/CHANGES.md +9 -0
  2. {pulp_python-3.12.9 → pulp_python-3.12.10}/MANIFEST.in +2 -0
  3. {pulp_python-3.12.9 → pulp_python-3.12.10}/PKG-INFO +1 -1
  4. pulp_python-3.12.10/functest_requirements.txt +10 -0
  5. pulp_python-3.12.10/pulp_python/__init__.py +1 -0
  6. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/app/__init__.py +5 -3
  7. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/app/global_access_conditions.py +0 -1
  8. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/app/modelresource.py +1 -0
  9. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/app/models.py +8 -7
  10. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/app/pypi/serializers.py +12 -10
  11. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/app/pypi/views.py +69 -54
  12. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/app/replica.py +3 -2
  13. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/app/serializers.py +192 -115
  14. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/app/settings.py +1 -1
  15. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/app/tasks/publish.py +24 -25
  16. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/app/tasks/sync.py +18 -32
  17. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/app/tasks/upload.py +13 -14
  18. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/app/urls.py +5 -5
  19. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/app/utils.py +38 -36
  20. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/app/viewsets.py +43 -46
  21. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/pytest_plugin.py +14 -5
  22. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/tests/functional/api/test_consume_content.py +0 -1
  23. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/tests/functional/api/test_crud_content_unit.py +8 -5
  24. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/tests/functional/api/test_crud_publications.py +9 -6
  25. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/tests/functional/api/test_crud_remotes.py +3 -2
  26. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/tests/functional/api/test_domains.py +10 -8
  27. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/tests/functional/api/test_export_import.py +7 -4
  28. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/tests/functional/api/test_pypi_apis.py +13 -18
  29. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/tests/functional/api/test_rbac.py +4 -2
  30. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/tests/functional/api/test_sync.py +28 -19
  31. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/tests/functional/constants.py +15 -33
  32. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/tests/functional/utils.py +15 -6
  33. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python.egg-info/PKG-INFO +1 -1
  34. {pulp_python-3.12.9 → pulp_python-3.12.10}/pyproject.toml +30 -1
  35. {pulp_python-3.12.9 → pulp_python-3.12.10}/setup.py +2 -2
  36. pulp_python-3.12.9/functest_requirements.txt +0 -9
  37. pulp_python-3.12.9/pulp_python/__init__.py +0 -1
  38. {pulp_python-3.12.9 → pulp_python-3.12.10}/COMMITMENT +0 -0
  39. {pulp_python-3.12.9 → pulp_python-3.12.10}/COPYRIGHT +0 -0
  40. {pulp_python-3.12.9 → pulp_python-3.12.10}/LICENSE +0 -0
  41. {pulp_python-3.12.9 → pulp_python-3.12.10}/README.md +0 -0
  42. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/app/fields.py +1 -1
  43. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/app/migrations/0001_initial.py +0 -0
  44. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/app/migrations/0002_pythonpackagecontent_python_version.py +0 -0
  45. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/app/migrations/0003_new_sync_filters.py +0 -0
  46. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/app/migrations/0004_DATA_swap_distribution_model.py +0 -0
  47. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/app/migrations/0005_pythonpackagecontent_sha256.py +0 -0
  48. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/app/migrations/0006_pythonrepository_autopublish.py +0 -0
  49. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/app/migrations/0007_pythonpackagecontent_mv-2-1.py +0 -0
  50. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/app/migrations/0008_pythonpackagecontent_unique_sha256.py +0 -0
  51. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/app/migrations/0009_pythondistribution_allow_uploads.py +0 -0
  52. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/app/migrations/0010_update_json_field.py +0 -0
  53. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/app/migrations/0011_alter_pythondistribution_distribution_ptr_and_more.py +0 -0
  54. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/app/migrations/0012_add_domain.py +0 -0
  55. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/app/migrations/0013_add_rbac_permissions.py +0 -0
  56. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/app/migrations/__init__.py +0 -0
  57. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/app/pypi/__init__.py +0 -0
  58. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/app/tasks/__init__.py +0 -0
  59. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/app/webserver_snippets/__init__.py +0 -0
  60. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/app/webserver_snippets/apache.conf +0 -0
  61. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/app/webserver_snippets/nginx.conf +0 -0
  62. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/tests/__init__.py +0 -0
  63. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/tests/functional/__init__.py +0 -0
  64. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/tests/functional/api/__init__.py +0 -0
  65. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/tests/functional/api/test_auto_publish.py +0 -0
  66. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/tests/functional/api/test_download_content.py +2 -2
  67. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/tests/functional/api/test_full_mirror.py +4 -4
  68. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/tests/unit/__init__.py +0 -0
  69. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python/tests/unit/test_models.py +0 -0
  70. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python.egg-info/SOURCES.txt +0 -0
  71. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python.egg-info/dependency_links.txt +0 -0
  72. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python.egg-info/entry_points.txt +0 -0
  73. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python.egg-info/requires.txt +0 -0
  74. {pulp_python-3.12.9 → pulp_python-3.12.10}/pulp_python.egg-info/top_level.txt +0 -0
  75. {pulp_python-3.12.9 → pulp_python-3.12.10}/requirements.txt +0 -0
  76. {pulp_python-3.12.9 → pulp_python-3.12.10}/setup.cfg +0 -0
  77. {pulp_python-3.12.9 → pulp_python-3.12.10}/test_requirements.txt +0 -0
  78. {pulp_python-3.12.9 → pulp_python-3.12.10}/unittest_requirements.txt +0 -0
@@ -8,6 +8,15 @@
8
8
 
9
9
  [//]: # (towncrier release notes start)
10
10
 
11
+ ## 3.12.10 (2026-10-08) {: #3.12.10 }
12
+
13
+ #### Bugfixes {: #3.12.10-bugfix }
14
+
15
+ - Fixed quoting mistake in simple html detail pages that can lead to a possible XSS attack.
16
+ - Fixed quoting mistake in simple html index pages that can lead to a possible XSS attack given a carefully crafted package name. CVE-2026-103871
17
+
18
+ ---
19
+
11
20
  ## 3.12.9 (2026-04-01) {: #3.12.9 }
12
21
 
13
22
  #### Bugfixes {: #3.12.9-bugfix }
@@ -9,3 +9,5 @@ include test_requirements.txt
9
9
  include unittest_requirements.txt
10
10
  include pulp_python/app/webserver_snippets/*
11
11
  exclude releasing.md
12
+
13
+ exclude .gitleaks.toml
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pulp-python
3
- Version: 3.12.9
3
+ Version: 3.12.10
4
4
  Summary: pulp-python plugin for the Pulp Project
5
5
  Home-page: https://www.pulpproject.org
6
6
  Author: Pulp Project Developers
@@ -0,0 +1,10 @@
1
+ pytest<8
2
+ lxml
3
+ # test_attestation_twine_upload and test_twine_upload use shelf-reader 0.1 with Metadata-Version 2.0, rejected by twine>=7
4
+ twine<7
5
+ pypi-simple
6
+ pytest-custom_exit_code
7
+ pytest-xdist
8
+ proxy.py~=2.4.4
9
+ trustme~=1.1.0
10
+ pytest-timeout
@@ -0,0 +1 @@
1
+ default_app_config = "pulp_python.app.PulpPythonPluginAppConfig"
@@ -1,6 +1,8 @@
1
+ from gettext import gettext as _
2
+
1
3
  from django.db.models.signals import post_migrate
4
+
2
5
  from pulpcore.plugin import PulpPluginAppConfig
3
- from gettext import gettext as _
4
6
 
5
7
 
6
8
  class PulpPythonPluginAppConfig(PulpPluginAppConfig):
@@ -10,7 +12,7 @@ class PulpPythonPluginAppConfig(PulpPluginAppConfig):
10
12
 
11
13
  name = "pulp_python.app"
12
14
  label = "python"
13
- version = "3.12.9"
15
+ version = "3.12.10"
14
16
  python_package_name = "pulp-python"
15
17
  domain_compatible = True
16
18
 
@@ -26,7 +28,7 @@ class PulpPythonPluginAppConfig(PulpPluginAppConfig):
26
28
 
27
29
  # TODO: Remove this when https://github.com/pulp/pulpcore/issues/5500 is resolved
28
30
  def _populate_pypi_access_policies(sender, apps, verbosity, **kwargs):
29
- from pulp_python.app.pypi.views import PyPIView, SimpleView, UploadView, MetadataView
31
+ from pulp_python.app.pypi.views import MetadataView, PyPIView, SimpleView, UploadView
30
32
 
31
33
  try:
32
34
  AccessPolicy = apps.get_model("core", "AccessPolicy")
@@ -1,6 +1,5 @@
1
1
  from django.conf import settings
2
2
 
3
-
4
3
  # Access Condition methods that can be used with PyPI access policies
5
4
 
6
5
 
@@ -1,6 +1,7 @@
1
1
  from pulpcore.plugin.importexport import BaseContentResource
2
2
  from pulpcore.plugin.modelresources import RepositoryResource
3
3
  from pulpcore.plugin.util import get_domain
4
+
4
5
  from pulp_python.app.models import (
5
6
  PythonPackageContent,
6
7
  PythonRepository,
@@ -1,31 +1,32 @@
1
1
  from logging import getLogger
2
+ from pathlib import PurePath
2
3
 
3
4
  from aiohttp.web import json_response
5
+ from django.conf import settings
4
6
  from django.contrib.postgres.fields import ArrayField
5
7
  from django.core.exceptions import ObjectDoesNotExist
6
8
  from django.db import models
7
- from django.conf import settings
9
+
8
10
  from pulpcore.plugin.models import (
9
11
  AutoAddObjPermsMixin,
10
12
  Content,
11
- Publication,
12
13
  Distribution,
14
+ Publication,
13
15
  Remote,
14
16
  Repository,
15
17
  )
18
+ from pulpcore.plugin.repo_version_utils import remove_duplicates, validate_repo_version
16
19
  from pulpcore.plugin.responses import ArtifactResponse
20
+ from pulpcore.plugin.util import get_domain, get_domain_pk
17
21
 
18
- from pathlib import PurePath
19
22
  from .utils import (
23
+ PYPI_LAST_SERIAL,
24
+ PYPI_SERIAL_CONSTANT,
20
25
  canonicalize_name,
21
26
  get_project_metadata_from_artifact,
22
27
  parse_project_metadata,
23
28
  python_content_to_json,
24
- PYPI_LAST_SERIAL,
25
- PYPI_SERIAL_CONSTANT,
26
29
  )
27
- from pulpcore.plugin.repo_version_utils import remove_duplicates, validate_repo_version
28
- from pulpcore.plugin.util import get_domain_pk, get_domain
29
30
 
30
31
  log = getLogger(__name__)
31
32
 
@@ -1,12 +1,14 @@
1
1
  import logging
2
2
  from gettext import gettext as _
3
3
 
4
+ from django.db.utils import IntegrityError
4
5
  from rest_framework import serializers
5
- from pulp_python.app.utils import DIST_EXTENSIONS
6
- from pulp_python.app import fields
6
+
7
7
  from pulpcore.plugin.models import Artifact
8
8
  from pulpcore.plugin.util import get_domain
9
- from django.db.utils import IntegrityError
9
+
10
+ from pulp_python.app import fields
11
+ from pulp_python.app.utils import DIST_EXTENSIONS
10
12
 
11
13
  log = logging.getLogger(__name__)
12
14
 
@@ -47,7 +49,7 @@ class PackageUploadSerializer(serializers.Serializer):
47
49
  action = serializers.CharField(
48
50
  help_text=_("Defaults to `file_upload`, don't change it or request will fail!"),
49
51
  default="file_upload",
50
- source=":action"
52
+ source=":action",
51
53
  )
52
54
  sha256_digest = serializers.CharField(
53
55
  help_text=_("SHA256 of package to validate upload integrity."),
@@ -60,17 +62,17 @@ class PackageUploadSerializer(serializers.Serializer):
60
62
  """Validates the request."""
61
63
  action = data.get(":action")
62
64
  if action != "file_upload":
63
- raise serializers.ValidationError(
64
- _("We do not support the :action {}").format(action)
65
- )
65
+ raise serializers.ValidationError(_("We do not support the :action {}").format(action))
66
66
  file = data.get("content")
67
67
  for ext, packagetype in DIST_EXTENSIONS.items():
68
68
  if file.name.endswith(ext):
69
69
  break
70
70
  else:
71
- raise serializers.ValidationError(_(
72
- "Extension on {} is not a valid python extension "
73
- "(.whl, .exe, .egg, .tar.gz, .tar.bz2, .zip)").format(file.name)
71
+ raise serializers.ValidationError(
72
+ _(
73
+ "Extension on {} is not a valid python extension "
74
+ "(.whl, .exe, .egg, .tar.gz, .tar.bz2, .zip)"
75
+ ).format(file.name)
74
76
  )
75
77
  sha256 = data.get("sha256_digest")
76
78
  digests = {"sha256": sha256} if sha256 else None
@@ -1,54 +1,53 @@
1
1
  import logging
2
- import requests
3
-
4
- from rest_framework.viewsets import ViewSet
5
- from rest_framework.response import Response
6
- from django.core.exceptions import ObjectDoesNotExist
7
- from django.shortcuts import redirect
8
- from datetime import datetime, timezone, timedelta
2
+ from datetime import datetime, timedelta, timezone
3
+ from itertools import chain
4
+ from pathlib import PurePath
5
+ from urllib.parse import urljoin, urlparse, urlunsplit
9
6
 
10
- from rest_framework.reverse import reverse
7
+ import requests
11
8
  from django.contrib.sessions.models import Session
9
+ from django.core.exceptions import ObjectDoesNotExist
12
10
  from django.db import transaction
13
11
  from django.db.utils import DatabaseError
14
12
  from django.http.response import (
15
13
  Http404,
16
- HttpResponseForbidden,
17
14
  HttpResponseBadRequest,
18
- StreamingHttpResponse
15
+ HttpResponseForbidden,
16
+ StreamingHttpResponse,
19
17
  )
18
+ from django.shortcuts import redirect
20
19
  from drf_spectacular.utils import extend_schema
21
20
  from dynaconf import settings
22
- from itertools import chain
23
21
  from packaging.utils import canonicalize_name
24
- from urllib.parse import urljoin, urlparse, urlunsplit
25
- from pathlib import PurePath
26
22
  from pypi_simple.parse_stream import parse_links_stream_response
23
+ from rest_framework.response import Response
24
+ from rest_framework.reverse import reverse
25
+ from rest_framework.viewsets import ViewSet
27
26
 
28
- from pulpcore.plugin.viewsets import OperationPostponedResponse
29
27
  from pulpcore.plugin.tasking import dispatch
30
28
  from pulpcore.plugin.util import get_domain
29
+ from pulpcore.plugin.viewsets import OperationPostponedResponse
30
+
31
+ from pulp_python.app import tasks
31
32
  from pulp_python.app.models import (
32
33
  PythonDistribution,
33
34
  PythonPackageContent,
34
35
  PythonPublication,
35
36
  )
36
37
  from pulp_python.app.pypi.serializers import (
37
- SummarySerializer,
38
38
  PackageMetadataSerializer,
39
39
  PackageUploadSerializer,
40
- PackageUploadTaskSerializer
40
+ PackageUploadTaskSerializer,
41
+ SummarySerializer,
41
42
  )
42
43
  from pulp_python.app.utils import (
43
- write_simple_index,
44
- write_simple_detail,
45
- python_content_to_json,
46
44
  PYPI_LAST_SERIAL,
47
45
  PYPI_SERIAL_CONSTANT,
46
+ python_content_to_json,
47
+ write_simple_detail,
48
+ write_simple_index,
48
49
  )
49
50
 
50
- from pulp_python.app import tasks
51
-
52
51
  log = logging.getLogger(__name__)
53
52
 
54
53
  BASE_CONTENT_URL = urljoin(settings.CONTENT_ORIGIN, settings.CONTENT_PATH_PREFIX)
@@ -158,10 +157,15 @@ class PackageUploadMixin(PyPIMixin):
158
157
  if settings.PYTHON_GROUP_UPLOADS:
159
158
  return self.upload_package_group(repo, artifact, filename, request.session)
160
159
 
161
- result = dispatch(tasks.upload, exclusive_resources=[artifact, repo],
162
- kwargs={"artifact_sha256": artifact.sha256,
163
- "filename": filename,
164
- "repository_pk": str(repo.pk)})
160
+ result = dispatch(
161
+ tasks.upload,
162
+ exclusive_resources=[artifact, repo],
163
+ kwargs={
164
+ "artifact_sha256": artifact.sha256,
165
+ "filename": filename,
166
+ "repository_pk": str(repo.pk),
167
+ },
168
+ )
165
169
  return OperationPostponedResponse(result, request)
166
170
 
167
171
  def upload_package_group(self, repo, artifact, filename, session):
@@ -175,10 +179,10 @@ class PackageUploadMixin(PyPIMixin):
175
179
  try:
176
180
  with transaction.atomic():
177
181
  sq.first()
178
- current_start = datetime.fromisoformat(session['start'])
182
+ current_start = datetime.fromisoformat(session["start"])
179
183
  if current_start >= datetime.now(tz=timezone.utc):
180
- session['artifacts'].append((str(artifact.sha256), filename))
181
- session['start'] = str(start_time)
184
+ session["artifacts"].append((str(artifact.sha256), filename))
185
+ session["start"] = str(start_time)
182
186
  session.modified = False
183
187
  session.save()
184
188
  else:
@@ -191,14 +195,19 @@ class PackageUploadMixin(PyPIMixin):
191
195
 
192
196
  def create_group_upload_task(self, cur_session, repository, artifact, filename, start_time):
193
197
  """Creates the actual task that adds the packages to the index."""
194
- cur_session['start'] = str(start_time)
195
- cur_session['artifacts'] = [(str(artifact.sha256), filename)]
198
+ cur_session["start"] = str(start_time)
199
+ cur_session["artifacts"] = [(str(artifact.sha256), filename)]
196
200
  cur_session.modified = False
197
201
  cur_session.save()
198
- result = dispatch(tasks.upload_group, exclusive_resources=[artifact, repository],
199
- kwargs={"session_pk": str(cur_session.session_key),
200
- "repository_pk": str(repository.pk)})
201
- return reverse('tasks-detail', args=[result.pk], request=None)
202
+ result = dispatch(
203
+ tasks.upload_group,
204
+ exclusive_resources=[artifact, repository],
205
+ kwargs={
206
+ "session_pk": str(cur_session.session_key),
207
+ "repository_pk": str(repository.pk),
208
+ },
209
+ )
210
+ return reverse("tasks-detail", args=[result.pk], request=None)
202
211
 
203
212
 
204
213
  class SimpleView(PackageUploadMixin, ViewSet):
@@ -226,21 +235,22 @@ class SimpleView(PackageUploadMixin, ViewSet):
226
235
  """Gets the simple api html page for the index."""
227
236
  repo_version, content = self.get_rvc()
228
237
  if self.should_redirect(repo_version=repo_version):
229
- return redirect(urljoin(self.base_content_url, f'{path}/simple/'))
230
- names = content.order_by('name').values_list('name', flat=True).distinct().iterator()
238
+ return redirect(urljoin(self.base_content_url, f"{path}/simple/"))
239
+ names = content.order_by("name").values_list("name", flat=True).distinct().iterator()
231
240
  return StreamingHttpResponse(write_simple_index(names, streamed=True))
232
241
 
233
242
  def pull_through_package_simple(self, package, path, remote):
234
243
  """Gets the package's simple page from remote."""
244
+
235
245
  def parse_url(link):
236
246
  parsed = urlparse(link.url)
237
- digest, _, value = parsed.fragment.partition('=')
247
+ digest, _, value = parsed.fragment.partition("=")
238
248
  stripped_url = urlunsplit(chain(parsed[:3], ("", "")))
239
- redirect = f'{path}/{link.text}?redirect={stripped_url}'
249
+ redirect = f"{path}/{link.text}?redirect={stripped_url}"
240
250
  d_url = urljoin(self.base_content_url, redirect)
241
- return link.text, d_url, value if digest == 'sha256' else ''
251
+ return link.text, d_url, value if digest == "sha256" else ""
242
252
 
243
- url = remote.get_remote_artifact_url(f'simple/{package}/')
253
+ url = remote.get_remote_artifact_url(f"simple/{package}/")
244
254
  kwargs = {}
245
255
  if proxy_url := remote.proxy_url:
246
256
  if remote.proxy_username or remote.proxy_password:
@@ -264,10 +274,10 @@ class SimpleView(PackageUploadMixin, ViewSet):
264
274
  if not repo_ver or not content.filter(name__normalize=normalized).exists():
265
275
  return self.pull_through_package_simple(normalized, path, self.distribution.remote)
266
276
  if self.should_redirect(repo_version=repo_ver):
267
- return redirect(urljoin(self.base_content_url, f'{path}/simple/{normalized}/'))
277
+ return redirect(urljoin(self.base_content_url, f"{path}/simple/{normalized}/"))
268
278
  packages = (
269
279
  content.filter(name__normalize=normalized)
270
- .values_list('filename', 'sha256', 'name')
280
+ .values_list("filename", "sha256", "name")
271
281
  .iterator()
272
282
  )
273
283
  try:
@@ -277,12 +287,14 @@ class SimpleView(PackageUploadMixin, ViewSet):
277
287
  else:
278
288
  packages = chain([present], packages)
279
289
  name = present[2]
280
- releases = ((f, urljoin(self.base_content_url, f'{path}/{f}'), d) for f, d, _ in packages)
290
+ releases = ((f, urljoin(self.base_content_url, f"{path}/{f}"), d) for f, d, _ in packages)
281
291
  return StreamingHttpResponse(write_simple_detail(name, releases, streamed=True))
282
292
 
283
- @extend_schema(request=PackageUploadSerializer,
284
- responses={200: PackageUploadTaskSerializer},
285
- summary="Upload a package")
293
+ @extend_schema(
294
+ request=PackageUploadSerializer,
295
+ responses={200: PackageUploadTaskSerializer},
296
+ summary="Upload a package",
297
+ )
286
298
  def create(self, request, path):
287
299
  """
288
300
  Upload package to the index.
@@ -307,9 +319,11 @@ class MetadataView(PyPIMixin, ViewSet):
307
319
  ],
308
320
  }
309
321
 
310
- @extend_schema(tags=["Pypi: Metadata"],
311
- responses={200: PackageMetadataSerializer},
312
- summary="Get package metadata")
322
+ @extend_schema(
323
+ tags=["Pypi: Metadata"],
324
+ responses={200: PackageMetadataSerializer},
325
+ summary="Get package metadata",
326
+ )
313
327
  def retrieve(self, request, path, meta):
314
328
  """
315
329
  Retrieves the package's core-metadata specified by
@@ -355,8 +369,7 @@ class PyPIView(PyPIMixin, ViewSet):
355
369
  ],
356
370
  }
357
371
 
358
- @extend_schema(responses={200: SummarySerializer},
359
- summary="Get index summary")
372
+ @extend_schema(responses={200: SummarySerializer}, summary="Get index summary")
360
373
  def retrieve(self, request, path):
361
374
  """Gets package summary stats of index."""
362
375
  repo_ver, content = self.get_rvc()
@@ -382,9 +395,11 @@ class UploadView(PackageUploadMixin, ViewSet):
382
395
  ],
383
396
  }
384
397
 
385
- @extend_schema(request=PackageUploadSerializer,
386
- responses={200: PackageUploadTaskSerializer},
387
- summary="Upload a package")
398
+ @extend_schema(
399
+ request=PackageUploadSerializer,
400
+ responses={200: PackageUploadTaskSerializer},
401
+ summary="Upload a package",
402
+ )
388
403
  def create(self, request, path):
389
404
  """
390
405
  Upload package to the index.
@@ -1,10 +1,11 @@
1
- from pulpcore.plugin.replica import Replicator
2
-
3
1
  from pulp_glue.python.context import (
4
2
  PulpPythonDistributionContext,
5
3
  PulpPythonPublicationContext,
6
4
  PulpPythonRepositoryContext,
7
5
  )
6
+
7
+ from pulpcore.plugin.replica import Replicator
8
+
8
9
  from pulp_python.app.models import PythonDistribution, PythonRemote, PythonRepository
9
10
  from pulp_python.app.tasks import sync as python_sync
10
11