Skip to content

Commit b09c747

Browse files
dimblebyneersighted
authored andcommitted
remove unused Link parameters
1 parent 5df38f4 commit b09c747

File tree

1 file changed

+2
-10
lines changed
  • src/poetry/core/packages/utils

1 file changed

+2
-10
lines changed

src/poetry/core/packages/utils/link.py

+2-10
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
import re
55
import urllib.parse as urlparse
66

7-
from typing import Any
8-
97
from poetry.core.packages.utils.utils import path_to_url
108
from poetry.core.packages.utils.utils import splitext
119

@@ -14,7 +12,6 @@ class Link:
1412
def __init__(
1513
self,
1614
url: str,
17-
comes_from: Any | None = None,
1815
requires_python: str | None = None,
1916
metadata: str | bool | None = None,
2017
) -> None:
@@ -23,8 +20,6 @@ def __init__(
2320
2421
url:
2522
url of the resource pointed to (href of the link)
26-
comes_from:
27-
instance of HTMLPage where the link was found, or string.
2823
requires_python:
2924
String containing the `Requires-Python` metadata field, specified
3025
in PEP 345. This may be specified by a data-requires-python
@@ -41,7 +36,6 @@ def __init__(
4136
url = path_to_url(url)
4237

4338
self.url = url
44-
self.comes_from = comes_from
4539
self.requires_python = requires_python if requires_python else None
4640

4741
if isinstance(metadata, str):
@@ -56,10 +50,8 @@ def __str__(self) -> str:
5650
rp = f" (requires-python:{self.requires_python})"
5751
else:
5852
rp = ""
59-
if self.comes_from:
60-
return f"{self.url} (from {self.comes_from}){rp}"
61-
else:
62-
return str(self.url)
53+
54+
return f"{self.url}{rp}"
6355

6456
def __repr__(self) -> str:
6557
return f"<Link {self!s}>"

0 commit comments

Comments
 (0)