diff --git a/src/poetry/core/packages/utils/link.py b/src/poetry/core/packages/utils/link.py index bfa0fde6c..fd9b18814 100644 --- a/src/poetry/core/packages/utils/link.py +++ b/src/poetry/core/packages/utils/link.py @@ -4,8 +4,6 @@ import re import urllib.parse as urlparse -from typing import Any - from poetry.core.packages.utils.utils import path_to_url from poetry.core.packages.utils.utils import splitext @@ -14,8 +12,6 @@ class Link: def __init__( self, url: str, - comes_from: Any | None = None, - requires_python: str | None = None, metadata: str | bool | None = None, ) -> None: """ @@ -23,12 +19,6 @@ def __init__( url: url of the resource pointed to (href of the link) - comes_from: - instance of HTMLPage where the link was found, or string. - requires_python: - String containing the `Requires-Python` metadata field, specified - in PEP 345. This may be specified by a data-requires-python - attribute in the HTML link tag, as described in PEP 503. metadata: String of the syntax `=` representing the hash of the Core Metadata file. This may be specified by a @@ -41,9 +31,6 @@ def __init__( url = path_to_url(url) self.url = url - self.comes_from = comes_from - self.requires_python = requires_python if requires_python else None - if isinstance(metadata, str): metadata = {"true": True, "": False, "false": False}.get( metadata.strip().lower(), metadata @@ -52,14 +39,7 @@ def __init__( self._metadata = metadata def __str__(self) -> str: - if self.requires_python: - rp = f" (requires-python:{self.requires_python})" - else: - rp = "" - if self.comes_from: - return f"{self.url} (from {self.comes_from}){rp}" - else: - return str(self.url) + return str(self.url) def __repr__(self) -> str: return f""