Skip to content

Commit eec0b46

Browse files
committed
Remove file.publisher_url which is no longer used.
1 parent 9914be2 commit eec0b46

File tree

2 files changed

+2
-18
lines changed

2 files changed

+2
-18
lines changed

warehouse/forklift/legacy.py

+2
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,7 @@ def _is_duplicate_file(db_session, filename, hashes):
368368

369369
return None
370370

371+
371372
_pypi_project_urls = [
372373
"https://pypi.org/project/",
373374
"https://pypi.org/p/",
@@ -391,6 +392,7 @@ def _verify_url_pypi(url: str, project_name: str, project_normalized_name: str)
391392
for candidate_url in candidate_urls
392393
)
393394

395+
394396
def _verify_url_with_trusted_publisher(url: str, publisher_url: str) -> bool:
395397
"""
396398
Verify a given URL against a Trusted Publisher URL

warehouse/packaging/models.py

-18
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@
6565
from warehouse.authnz import Permissions
6666
from warehouse.classifiers.models import Classifier
6767
from warehouse.events.models import HasEvents
68-
from warehouse.events.tags import EventTag
6968
from warehouse.integrations.vulnerabilities.models import VulnerabilityRecord
7069
from warehouse.observations.models import HasObservations
7170
from warehouse.organizations.models import (
@@ -842,23 +841,6 @@ def __table_args__(cls): # noqa
842841
passive_deletes=True,
843842
)
844843

845-
@property
846-
def publisher_url(self) -> str | None:
847-
event_tag = self.Event.tag # type: ignore[attr-defined]
848-
event_additional = self.Event.additional # type: ignore[attr-defined]
849-
850-
try:
851-
release_event = self.events.where(
852-
sql.and_(
853-
event_tag == EventTag.File.FileAdd,
854-
event_additional["publisher_url"].as_string().is_not(None),
855-
)
856-
).one()
857-
except (NoResultFound, MultipleResultsFound):
858-
return None
859-
860-
return release_event.additional["publisher_url"]
861-
862844
@property
863845
def uploaded_via_trusted_publisher(self) -> bool:
864846
"""Return True if the file was uploaded via a trusted publisher."""

0 commit comments

Comments
 (0)