4
4
import re
5
5
import urllib .parse as urlparse
6
6
7
- from typing import Any
8
-
9
7
from poetry .core .packages .utils .utils import path_to_url
10
8
from poetry .core .packages .utils .utils import splitext
11
9
@@ -14,7 +12,6 @@ class Link:
14
12
def __init__ (
15
13
self ,
16
14
url : str ,
17
- comes_from : Any | None = None ,
18
15
requires_python : str | None = None ,
19
16
metadata : str | bool | None = None ,
20
17
) -> None :
@@ -23,8 +20,6 @@ def __init__(
23
20
24
21
url:
25
22
url of the resource pointed to (href of the link)
26
- comes_from:
27
- instance of HTMLPage where the link was found, or string.
28
23
requires_python:
29
24
String containing the `Requires-Python` metadata field, specified
30
25
in PEP 345. This may be specified by a data-requires-python
@@ -41,7 +36,6 @@ def __init__(
41
36
url = path_to_url (url )
42
37
43
38
self .url = url
44
- self .comes_from = comes_from
45
39
self .requires_python = requires_python if requires_python else None
46
40
47
41
if isinstance (metadata , str ):
@@ -56,10 +50,8 @@ def __str__(self) -> str:
56
50
rp = f" (requires-python:{ self .requires_python } )"
57
51
else :
58
52
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 } "
63
55
64
56
def __repr__ (self ) -> str :
65
57
return f"<Link { self !s} >"
0 commit comments