Skip to content

Commit

Permalink
fix typing
Browse files Browse the repository at this point in the history
  • Loading branch information
dstufft committed Jun 25, 2022
1 parent b15b9f6 commit 0fa0ae3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/pip/_internal/models/link.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from pip._internal.utils.urls import path_to_url, url_to_path

if TYPE_CHECKING:
from pip._internal.index.collector import HTMLPage
from pip._internal.index.collector import IndexContent

logger = logging.getLogger(__name__)

Expand All @@ -33,6 +33,7 @@ class Link(KeyBasedCompareMixin):
__slots__ = [
"_parsed_url",
"_url",
"_hashes",
"comes_from",
"requires_python",
"yanked_reason",
Expand All @@ -42,15 +43,15 @@ class Link(KeyBasedCompareMixin):
def __init__(
self,
url: str,
comes_from: Optional[Union[str, "HTMLPage"]] = None,
comes_from: Optional[Union[str, "IndexContent"]] = None,
requires_python: Optional[str] = None,
yanked_reason: Optional[str] = None,
cache_link_parsing: bool = True,
hashes: Optional[dict[str, str]] = None,
) -> None:
"""
:param url: url of the resource pointed to (href of the link)
:param comes_from: instance of HTMLPage where the link was found,
:param comes_from: instance of IndexContent where the link was found,
or string.
:param requires_python: String containing the `Requires-Python`
metadata field, specified in PEP 345. This may be specified by
Expand Down

0 comments on commit 0fa0ae3

Please sign in to comment.