Skip to content

Commit

Permalink
fix: remove index_url key
Browse files Browse the repository at this point in the history
Signed-off-by: Frost Ming <[email protected]>
  • Loading branch information
frostming committed Jul 30, 2024
1 parent 8058807 commit 2e7ed46
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions src/pdm/models/candidates.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import dataclasses
import hashlib
import os
import posixpath
import re
import warnings
from functools import cached_property
Expand Down Expand Up @@ -402,14 +401,8 @@ def provenance_url(self) -> dict[str, Any] | None:
if not isinstance(req, NamedRequirement):
return None

Check warning on line 402 in src/pdm/models/candidates.py

View check run for this annotation

Codecov / codecov/patch

src/pdm/models/candidates.py#L402

Added line #L402 was not covered by tests
assert self.link is not None
comes_from = self.link.comes_from # e.g. https://pypi.org/simple/requests/
if comes_from is None: # can't determine the index_url
return None
# FIXME: what about find-links source?
index_url = posixpath.dirname(comes_from.rstrip("/")) + "/"
return {
"url": self.link.url_without_fragment,
"index_url": index_url,
"archive_info": {
"hashes": {
name: hashes[0] for name, hashes in (self.link.hash_option or {}).items() if name in ALLOWED_HASHES
Expand Down

0 comments on commit 2e7ed46

Please sign in to comment.