@@ -129,6 +129,29 @@ def test_install_req_from_string_pep508_url_wheel(self, use_pep517):
129
129
assert install_req .is_wheel
130
130
assert install_req .use_pep517 == use_pep517
131
131
132
+ @pytest .mark .parametrize ("use_pep517" , [None , True , False ])
133
+ def test_install_req_from_string_pep508_url_wheel_extras (self , use_pep517 ):
134
+ """
135
+ install_req_from_string parses the version and extras from PEP 508 URLs
136
+ that point to wheels so that updating the URL reinstalls the package.
137
+ """
138
+ wheel_url = (
139
+ "https://files.pythonhosted.org/packages/51/bd/"
140
+ "23c926cd341ea6b7dd0b2a00aba99ae0f828be89d72b2190f27c11d4b7fb/"
141
+ "requests-2.22.0-py2.py3-none-any.whl"
142
+ )
143
+ install_str = "requests[security] @ " + wheel_url
144
+ install_req = install_req_from_req_string (
145
+ install_str , use_pep517 = use_pep517
146
+ )
147
+
148
+ assert isinstance (install_req , InstallRequirement )
149
+ assert str (install_req .req ) == "requests==2.22.0"
150
+ assert install_req .link .url == wheel_url
151
+ assert install_req .is_wheel
152
+ assert install_req .use_pep517 == use_pep517
153
+ assert install_req .extras == {"security" }
154
+
132
155
@pytest .mark .parametrize ("use_pep517" , [None , True , False ])
133
156
def test_install_req_from_string_pep508_url_not_a_wheel (
134
157
self , use_pep517 , tmpdir ):
0 commit comments