pulp-python 3.11.7__tar.gz → 3.11.9__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.11.7 → pulp_python-3.11.9}/CHANGES.md +15 -0
  2. {pulp_python-3.11.7 → pulp_python-3.11.9}/MANIFEST.in +2 -0
  3. {pulp_python-3.11.7 → pulp_python-3.11.9}/PKG-INFO +2 -2
  4. pulp_python-3.11.9/functest_requirements.txt +8 -0
  5. pulp_python-3.11.9/pulp_python/__init__.py +1 -0
  6. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python/app/__init__.py +1 -1
  7. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python/app/modelresource.py +1 -0
  8. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python/app/models.py +8 -7
  9. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python/app/pypi/serializers.py +12 -10
  10. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python/app/pypi/views.py +70 -55
  11. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python/app/serializers.py +192 -115
  12. pulp_python-3.11.9/pulp_python/app/settings.py +4 -0
  13. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python/app/tasks/publish.py +24 -25
  14. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python/app/tasks/sync.py +18 -32
  15. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python/app/tasks/upload.py +11 -12
  16. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python/app/urls.py +6 -6
  17. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python/app/utils.py +40 -39
  18. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python/app/viewsets.py +42 -44
  19. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python/tests/functional/api/test_auto_publish.py +5 -3
  20. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python/tests/functional/api/test_consume_content.py +10 -11
  21. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python/tests/functional/api/test_crud_content_unit.py +17 -22
  22. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python/tests/functional/api/test_crud_publications.py +13 -15
  23. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python/tests/functional/api/test_crud_remotes.py +11 -14
  24. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python/tests/functional/api/test_download_content.py +10 -17
  25. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python/tests/functional/api/test_export_import.py +7 -8
  26. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python/tests/functional/api/test_full_mirror.py +21 -19
  27. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python/tests/functional/api/test_pypi_apis.py +23 -27
  28. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python/tests/functional/api/test_sync.py +41 -58
  29. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python/tests/functional/conftest.py +14 -4
  30. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python/tests/functional/constants.py +33 -44
  31. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python/tests/functional/utils.py +34 -22
  32. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python/tests/upgrade/post/test_publish.py +11 -10
  33. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python/tests/upgrade/pre/test_publish.py +12 -11
  34. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python.egg-info/PKG-INFO +2 -2
  35. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python.egg-info/requires.txt +1 -1
  36. {pulp_python-3.11.7 → pulp_python-3.11.9}/pyproject.toml +32 -1
  37. {pulp_python-3.11.7 → pulp_python-3.11.9}/requirements.txt +1 -1
  38. {pulp_python-3.11.7 → pulp_python-3.11.9}/setup.py +7 -3
  39. pulp_python-3.11.7/functest_requirements.txt +0 -7
  40. pulp_python-3.11.7/pulp_python/__init__.py +0 -1
  41. pulp_python-3.11.7/pulp_python/app/settings.py +0 -4
  42. {pulp_python-3.11.7 → pulp_python-3.11.9}/COMMITMENT +0 -0
  43. {pulp_python-3.11.7 → pulp_python-3.11.9}/COPYRIGHT +0 -0
  44. {pulp_python-3.11.7 → pulp_python-3.11.9}/LICENSE +0 -0
  45. {pulp_python-3.11.7 → pulp_python-3.11.9}/README.md +0 -0
  46. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python/app/fields.py +1 -1
  47. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python/app/migrations/0001_initial.py +0 -0
  48. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python/app/migrations/0002_pythonpackagecontent_python_version.py +0 -0
  49. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python/app/migrations/0003_new_sync_filters.py +0 -0
  50. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python/app/migrations/0004_DATA_swap_distribution_model.py +0 -0
  51. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python/app/migrations/0005_pythonpackagecontent_sha256.py +0 -0
  52. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python/app/migrations/0006_pythonrepository_autopublish.py +0 -0
  53. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python/app/migrations/0007_pythonpackagecontent_mv-2-1.py +0 -0
  54. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python/app/migrations/0008_pythonpackagecontent_unique_sha256.py +0 -0
  55. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python/app/migrations/0009_pythondistribution_allow_uploads.py +0 -0
  56. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python/app/migrations/0010_update_json_field.py +0 -0
  57. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python/app/migrations/0011_alter_pythondistribution_distribution_ptr_and_more.py +0 -0
  58. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python/app/migrations/__init__.py +0 -0
  59. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python/app/pypi/__init__.py +0 -0
  60. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python/app/tasks/__init__.py +0 -0
  61. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python/app/webserver_snippets/__init__.py +0 -0
  62. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python/app/webserver_snippets/apache.conf +0 -0
  63. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python/app/webserver_snippets/nginx.conf +0 -0
  64. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python/tests/__init__.py +0 -0
  65. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python/tests/functional/__init__.py +0 -0
  66. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python/tests/functional/api/__init__.py +0 -0
  67. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python/tests/unit/__init__.py +0 -0
  68. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python/tests/unit/test_models.py +0 -0
  69. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python/tests/upgrade/__init__.py +0 -0
  70. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python/tests/upgrade/post/__init__.py +0 -0
  71. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python/tests/upgrade/pre/__init__.py +0 -0
  72. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python.egg-info/SOURCES.txt +0 -0
  73. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python.egg-info/dependency_links.txt +0 -0
  74. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python.egg-info/entry_points.txt +0 -0
  75. {pulp_python-3.11.7 → pulp_python-3.11.9}/pulp_python.egg-info/top_level.txt +0 -0
  76. {pulp_python-3.11.7 → pulp_python-3.11.9}/setup.cfg +0 -0
  77. {pulp_python-3.11.7 → pulp_python-3.11.9}/test_requirements.txt +0 -0
  78. {pulp_python-3.11.7 → pulp_python-3.11.9}/unittest_requirements.txt +0 -0
@@ -8,6 +8,21 @@
8
8
 
9
9
  [//]: # (towncrier release notes start)
10
10
 
11
+ ## 3.11.9 (2026-10-08) {: #3.11.9 }
12
+
13
+ #### Bugfixes {: #3.11.9-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
+
20
+ ## 3.11.8 (2026-04-21) {: #3.11.8 }
21
+
22
+ No significant changes.
23
+
24
+ ---
25
+
11
26
  ## 3.11.7 (2025-11-18) {: #3.11.7 }
12
27
 
13
28
  No significant changes.
@@ -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.11.7
3
+ Version: 3.11.9
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,7 +17,7 @@ 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.0
20
+ Requires-Dist: pulpcore<3.55,>=3.49.0
21
21
  Requires-Dist: pkginfo<1.13.0,>=1.12.0
22
22
  Requires-Dist: bandersnatch<6.2,>=6.1
23
23
  Requires-Dist: pypi-simple<1.0.0,>=0.9.0
@@ -0,0 +1,8 @@
1
+ git+https://github.com/pulp/pulp-smash.git#egg=pulp-smash
2
+ pytest<8
3
+ lxml
4
+ # test_attestation_twine_upload and test_twine_upload use shelf-reader 0.1 with Metadata-Version 2.0, rejected by twine>=7
5
+ twine<7
6
+ pypi-simple
7
+ pytest-xdist
8
+ pytest-timeout
@@ -0,0 +1 @@
1
+ default_app_config = "pulp_python.app.PulpPythonPluginAppConfig"
@@ -8,5 +8,5 @@ class PulpPythonPluginAppConfig(PulpPluginAppConfig):
8
8
 
9
9
  name = "pulp_python.app"
10
10
  label = "python"
11
- version = "3.11.7"
11
+ version = "3.11.9"
12
12
  python_package_name = "pulp-python"
@@ -1,5 +1,6 @@
1
1
  from pulpcore.plugin.importexport import BaseContentResource
2
2
  from pulpcore.plugin.modelresources import RepositoryResource
3
+
3
4
  from pulp_python.app.models import (
4
5
  PythonPackageContent,
5
6
  PythonRepository,
@@ -1,29 +1,30 @@
1
1
  from logging import getLogger
2
+ from pathlib import PurePath
2
3
 
3
4
  from aiohttp.web import json_response
4
5
  from django.contrib.postgres.fields import ArrayField
5
6
  from django.core.exceptions import ObjectDoesNotExist
6
7
  from django.db import models
7
- from django.conf import settings
8
+
8
9
  from pulpcore.plugin.models import (
9
10
  Content,
10
- Publication,
11
11
  Distribution,
12
+ Publication,
12
13
  Remote,
13
14
  Repository,
14
15
  )
16
+ from pulpcore.plugin.repo_version_utils import remove_duplicates, validate_repo_version
15
17
  from pulpcore.plugin.responses import ArtifactResponse
18
+ from pulpcore.plugin.util import get_domain
16
19
 
17
- from pathlib import PurePath
18
20
  from .utils import (
21
+ PYPI_LAST_SERIAL,
22
+ PYPI_SERIAL_CONSTANT,
19
23
  canonicalize_name,
20
24
  get_project_metadata_from_artifact,
21
25
  parse_project_metadata,
22
26
  python_content_to_json,
23
- PYPI_LAST_SERIAL,
24
- PYPI_SERIAL_CONSTANT,
25
27
  )
26
- from pulpcore.plugin.repo_version_utils import remove_duplicates, validate_repo_version
27
28
 
28
29
  log = getLogger(__name__)
29
30
 
@@ -77,7 +78,7 @@ class PythonDistribution(Distribution):
77
78
  elif len(path.parts) and path.parts[0] == "simple":
78
79
  # Temporary fix for PublishedMetadata not being properly served from remote storage
79
80
  # https://github.com/pulp/pulp_python/issues/413
80
- if settings.DEFAULT_FILE_STORAGE != "pulpcore.app.models.storage.FileSystem":
81
+ if get_domain().storage_class != "pulpcore.app.models.storage.FileSystem":
81
82
  if self.publication or self.repository:
82
83
  try:
83
84
  publication = self.publication or Publication.objects.filter(
@@ -1,11 +1,13 @@
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
- from django.db.utils import IntegrityError
8
+
9
+ from pulp_python.app import fields
10
+ from pulp_python.app.utils import DIST_EXTENSIONS
9
11
 
10
12
  log = logging.getLogger(__name__)
11
13
 
@@ -46,7 +48,7 @@ class PackageUploadSerializer(serializers.Serializer):
46
48
  action = serializers.CharField(
47
49
  help_text=_("Defaults to `file_upload`, don't change it or request will fail!"),
48
50
  default="file_upload",
49
- source=":action"
51
+ source=":action",
50
52
  )
51
53
  sha256_digest = serializers.CharField(
52
54
  help_text=_("SHA256 of package to validate upload integrity."),
@@ -59,17 +61,17 @@ class PackageUploadSerializer(serializers.Serializer):
59
61
  """Validates the request."""
60
62
  action = data.get(":action")
61
63
  if action != "file_upload":
62
- raise serializers.ValidationError(
63
- _("We do not support the :action {}").format(action)
64
- )
64
+ raise serializers.ValidationError(_("We do not support the :action {}").format(action))
65
65
  file = data.get("content")
66
66
  for ext, packagetype in DIST_EXTENSIONS.items():
67
67
  if file.name.endswith(ext):
68
68
  break
69
69
  else:
70
- raise serializers.ValidationError(_(
71
- "Extension on {} is not a valid python extension "
72
- "(.whl, .exe, .egg, .tar.gz, .tar.bz2, .zip)").format(file.name)
70
+ raise serializers.ValidationError(
71
+ _(
72
+ "Extension on {} is not a valid python extension "
73
+ "(.whl, .exe, .egg, .tar.gz, .tar.bz2, .zip)"
74
+ ).format(file.name)
73
75
  )
74
76
  sha256 = data.get("sha256_digest")
75
77
  digests = {"sha256": sha256} if sha256 else None
@@ -1,53 +1,52 @@
1
1
  import logging
2
- import requests
3
-
4
- from rest_framework.viewsets import ViewSet
5
- from rest_framework.response import Response
6
- from rest_framework.permissions import IsAuthenticatedOrReadOnly
7
- from django.core.exceptions import ObjectDoesNotExist
8
- from django.shortcuts import redirect
9
- 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
10
6
 
11
- from rest_framework.reverse import reverse
7
+ import requests
12
8
  from django.contrib.sessions.models import Session
9
+ from django.core.exceptions import ObjectDoesNotExist
13
10
  from django.db import transaction
14
11
  from django.db.utils import DatabaseError
15
12
  from django.http.response import (
16
13
  Http404,
17
- HttpResponseForbidden,
18
14
  HttpResponseBadRequest,
19
- StreamingHttpResponse
15
+ HttpResponseForbidden,
16
+ StreamingHttpResponse,
20
17
  )
18
+ from django.shortcuts import redirect
21
19
  from drf_spectacular.utils import extend_schema
22
20
  from dynaconf import settings
23
- from itertools import chain
24
21
  from packaging.utils import canonicalize_name
25
- from urllib.parse import urljoin, urlparse, urlunsplit
26
- from pathlib import PurePath
27
22
  from pypi_simple.parse_stream import parse_links_stream_response
23
+ from rest_framework.permissions import IsAuthenticatedOrReadOnly
24
+ from rest_framework.response import Response
25
+ from rest_framework.reverse import reverse
26
+ from rest_framework.viewsets import ViewSet
28
27
 
29
28
  from pulpcore.plugin.tasking import dispatch
29
+
30
+ from pulp_python.app import tasks
30
31
  from pulp_python.app.models import (
31
32
  PythonDistribution,
32
33
  PythonPackageContent,
33
34
  PythonPublication,
34
35
  )
35
36
  from pulp_python.app.pypi.serializers import (
36
- SummarySerializer,
37
37
  PackageMetadataSerializer,
38
38
  PackageUploadSerializer,
39
- PackageUploadTaskSerializer
39
+ PackageUploadTaskSerializer,
40
+ SummarySerializer,
40
41
  )
41
42
  from pulp_python.app.utils import (
42
- write_simple_index,
43
- write_simple_detail,
44
- python_content_to_json,
45
43
  PYPI_LAST_SERIAL,
46
44
  PYPI_SERIAL_CONSTANT,
45
+ python_content_to_json,
46
+ write_simple_detail,
47
+ write_simple_index,
47
48
  )
48
49
 
49
- from pulp_python.app import tasks
50
-
51
50
  log = logging.getLogger(__name__)
52
51
 
53
52
  BASE_CONTENT_URL = urljoin(settings.CONTENT_ORIGIN, settings.CONTENT_PATH_PREFIX)
@@ -133,11 +132,16 @@ class PackageUploadMixin(PyPIMixin):
133
132
  if settings.PYTHON_GROUP_UPLOADS:
134
133
  return self.upload_package_group(repo, artifact, filename, request.session)
135
134
 
136
- result = dispatch(tasks.upload, exclusive_resources=[artifact, repo],
137
- kwargs={"artifact_sha256": artifact.sha256,
138
- "filename": filename,
139
- "repository_pk": str(repo.pk)})
140
- return Response(data={"task": reverse('tasks-detail', args=[result.pk], request=None)})
135
+ result = dispatch(
136
+ tasks.upload,
137
+ exclusive_resources=[artifact, repo],
138
+ kwargs={
139
+ "artifact_sha256": artifact.sha256,
140
+ "filename": filename,
141
+ "repository_pk": str(repo.pk),
142
+ },
143
+ )
144
+ return Response(data={"task": reverse("tasks-detail", args=[result.pk], request=None)})
141
145
 
142
146
  def upload_package_group(self, repo, artifact, filename, session):
143
147
  """Steps 4 & 5, spawns tasks to add packages to index."""
@@ -150,10 +154,10 @@ class PackageUploadMixin(PyPIMixin):
150
154
  try:
151
155
  with transaction.atomic():
152
156
  sq.first()
153
- current_start = datetime.fromisoformat(session['start'])
157
+ current_start = datetime.fromisoformat(session["start"])
154
158
  if current_start >= datetime.now(tz=timezone.utc):
155
- session['artifacts'].append((str(artifact.sha256), filename))
156
- session['start'] = str(start_time)
159
+ session["artifacts"].append((str(artifact.sha256), filename))
160
+ session["start"] = str(start_time)
157
161
  session.modified = False
158
162
  session.save()
159
163
  else:
@@ -166,14 +170,19 @@ class PackageUploadMixin(PyPIMixin):
166
170
 
167
171
  def create_group_upload_task(self, cur_session, repository, artifact, filename, start_time):
168
172
  """Creates the actual task that adds the packages to the index."""
169
- cur_session['start'] = str(start_time)
170
- cur_session['artifacts'] = [(str(artifact.sha256), filename)]
173
+ cur_session["start"] = str(start_time)
174
+ cur_session["artifacts"] = [(str(artifact.sha256), filename)]
171
175
  cur_session.modified = False
172
176
  cur_session.save()
173
- result = dispatch(tasks.upload_group, exclusive_resources=[artifact, repository],
174
- kwargs={"session_pk": str(cur_session.session_key),
175
- "repository_pk": str(repository.pk)})
176
- return reverse('tasks-detail', args=[result.pk], request=None)
177
+ result = dispatch(
178
+ tasks.upload_group,
179
+ exclusive_resources=[artifact, repository],
180
+ kwargs={
181
+ "session_pk": str(cur_session.session_key),
182
+ "repository_pk": str(repository.pk),
183
+ },
184
+ )
185
+ return reverse("tasks-detail", args=[result.pk], request=None)
177
186
 
178
187
 
179
188
  class SimpleView(ViewSet, PackageUploadMixin):
@@ -186,21 +195,22 @@ class SimpleView(ViewSet, PackageUploadMixin):
186
195
  """Gets the simple api html page for the index."""
187
196
  distro, repo_version, content = self.get_drvc(path)
188
197
  if self.should_redirect(distro, repo_version=repo_version):
189
- return redirect(urljoin(BASE_CONTENT_URL, f'{path}/simple/'))
190
- names = content.order_by('name').values_list('name', flat=True).distinct().iterator()
198
+ return redirect(urljoin(BASE_CONTENT_URL, f"{path}/simple/"))
199
+ names = content.order_by("name").values_list("name", flat=True).distinct().iterator()
191
200
  return StreamingHttpResponse(write_simple_index(names, streamed=True))
192
201
 
193
202
  def pull_through_package_simple(self, package, path, remote):
194
203
  """Gets the package's simple page from remote."""
204
+
195
205
  def parse_url(link):
196
206
  parsed = urlparse(link.url)
197
- digest, _, value = parsed.fragment.partition('=')
207
+ digest, _, value = parsed.fragment.partition("=")
198
208
  stripped_url = urlunsplit(chain(parsed[:3], ("", "")))
199
- redirect = f'{path}/{link.text}?redirect={stripped_url}'
209
+ redirect = f"{path}/{link.text}?redirect={stripped_url}"
200
210
  d_url = urljoin(BASE_CONTENT_URL, redirect)
201
- return link.text, d_url, value if digest == 'sha256' else ''
211
+ return link.text, d_url, value if digest == "sha256" else ""
202
212
 
203
- url = remote.get_remote_artifact_url(f'simple/{package}/')
213
+ url = remote.get_remote_artifact_url(f"simple/{package}/")
204
214
  kwargs = {}
205
215
  if proxy_url := remote.proxy_url:
206
216
  if remote.proxy_username or remote.proxy_password:
@@ -224,10 +234,10 @@ class SimpleView(ViewSet, PackageUploadMixin):
224
234
  if not repo_ver or not content.filter(name__normalize=normalized).exists():
225
235
  return self.pull_through_package_simple(normalized, path, distro.remote)
226
236
  if self.should_redirect(distro, repo_version=repo_ver):
227
- return redirect(urljoin(BASE_CONTENT_URL, f'{path}/simple/{normalized}/'))
237
+ return redirect(urljoin(BASE_CONTENT_URL, f"{path}/simple/{normalized}/"))
228
238
  packages = (
229
239
  content.filter(name__normalize=normalized)
230
- .values_list('filename', 'sha256', 'name')
240
+ .values_list("filename", "sha256", "name")
231
241
  .iterator()
232
242
  )
233
243
  try:
@@ -237,12 +247,14 @@ class SimpleView(ViewSet, PackageUploadMixin):
237
247
  else:
238
248
  packages = chain([present], packages)
239
249
  name = present[2]
240
- releases = ((f, urljoin(BASE_CONTENT_URL, f'{path}/{f}'), d) for f, d, _ in packages)
250
+ releases = ((f, urljoin(BASE_CONTENT_URL, f"{path}/{f}"), d) for f, d, _ in packages)
241
251
  return StreamingHttpResponse(write_simple_detail(name, releases, streamed=True))
242
252
 
243
- @extend_schema(request=PackageUploadSerializer,
244
- responses={200: PackageUploadTaskSerializer},
245
- summary="Upload a package")
253
+ @extend_schema(
254
+ request=PackageUploadSerializer,
255
+ responses={200: PackageUploadTaskSerializer},
256
+ summary="Upload a package",
257
+ )
246
258
  def create(self, request, path):
247
259
  """
248
260
  Upload package to the index.
@@ -259,9 +271,11 @@ class MetadataView(ViewSet, PyPIMixin):
259
271
  authentication_classes = []
260
272
  permission_classes = []
261
273
 
262
- @extend_schema(tags=["Pypi: Metadata"],
263
- responses={200: PackageMetadataSerializer},
264
- summary="Get package metadata")
274
+ @extend_schema(
275
+ tags=["Pypi: Metadata"],
276
+ responses={200: PackageMetadataSerializer},
277
+ summary="Get package metadata",
278
+ )
265
279
  def retrieve(self, request, path, meta):
266
280
  """
267
281
  Retrieves the package's core-metadata specified by
@@ -294,8 +308,7 @@ class PyPIView(ViewSet, PyPIMixin):
294
308
  authentication_classes = []
295
309
  permission_classes = []
296
310
 
297
- @extend_schema(responses={200: SummarySerializer},
298
- summary="Get index summary")
311
+ @extend_schema(responses={200: SummarySerializer}, summary="Get index summary")
299
312
  def retrieve(self, request, path):
300
313
  """Gets package summary stats of index."""
301
314
  distro, repo_ver, content = self.get_drvc(path)
@@ -309,9 +322,11 @@ class PyPIView(ViewSet, PyPIMixin):
309
322
  class UploadView(ViewSet, PackageUploadMixin):
310
323
  """View for the `/legacy` upload endpoint."""
311
324
 
312
- @extend_schema(request=PackageUploadSerializer,
313
- responses={200: PackageUploadTaskSerializer},
314
- summary="Upload a package")
325
+ @extend_schema(
326
+ request=PackageUploadSerializer,
327
+ responses={200: PackageUploadTaskSerializer},
328
+ summary="Upload a package",
329
+ )
315
330
  def create(self, request, path):
316
331
  """
317
332
  Upload package to the index.