Skip to content

Commit

Permalink
Don't provide core-metadata attribute
Browse files Browse the repository at this point in the history
Fixes issue when pip tries to get unprovided metadata
  • Loading branch information
EpicWink committed Aug 16, 2024
1 parent 6816e24 commit cea1b84
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/proxpi/_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
_hostname_normalise_pattern = re.compile(r"[^a-z0-9]+")
_html_parser = lxml.etree.HTMLParser()

_ignored_file_attributes = ("href", "data-core-metadata", "data-dist-info-metadata")


@dataclasses.dataclass
class File:
Expand Down Expand Up @@ -231,10 +233,10 @@ def _list_files(self, package_name: str):
attributes = {
k: v
for k, v in child.attrib.items()
# Specifically ignore dist-info-metadat attribute: this version of
# Specifically ignore core metadata attributes: this version of
# proxpi doesn't support serving the file. See GitHub issue
# EpicWink/proxpi#23
if k not in ("href", "data-dist-info-metadata")
if k not in _ignored_file_attributes
}
fragment = urllib.parse.urlsplit(url).fragment
package.files[name] = File(name, url, fragment, attributes)
Expand Down

0 comments on commit cea1b84

Please sign in to comment.