14
14
import logging
15
15
import os
16
16
17
- from pip ._vendor .packaging .markers import Marker
18
17
from pip ._vendor .packaging .requirements import InvalidRequirement , Requirement
19
18
from pip ._vendor .packaging .specifiers import Specifier
20
19
from pip ._vendor .pkg_resources import RequirementParseError , parse_requirements
37
36
)
38
37
from pip ._internal .utils .typing import MYPY_CHECK_RUNNING
39
38
from pip ._internal .utils .urls import url_to_path
40
- from pip ._internal .vcs import is_url , vcs
39
+ from pip ._internal .vcs import vcs
41
40
from pip ._internal .wheel import Wheel
42
41
43
42
if MYPY_CHECK_RUNNING :
@@ -237,23 +236,8 @@ def with_source(text):
237
236
msg = with_source ('Invalid requirement: {!r}' .format (name ))
238
237
msg += '\n Hint: {}' .format (add_msg )
239
238
raise InstallationError (msg )
240
- if is_url (name ):
241
- marker_sep = '; '
242
- else :
243
- marker_sep = ';'
244
- if marker_sep in name :
245
- name , markers_as_string = name .split (marker_sep , 1 )
246
- markers_as_string = markers_as_string .strip ()
247
- if not markers_as_string :
248
- markers = None
249
- else :
250
- markers = Marker (markers_as_string )
251
- else :
252
- markers = None
253
- name = name .strip ()
254
- req_as_string = None
239
+
255
240
link = req .link
256
- extras_as_string = None
257
241
258
242
if link and link .scheme == 'file' :
259
243
p = link .path
@@ -277,10 +261,6 @@ def with_source(text):
277
261
'archives' .format (name ) + deduce_helpful_msg (p )
278
262
)
279
263
280
- if extras_as_string :
281
- extras = Requirement ("placeholder" + extras_as_string .lower ()).extras
282
- else :
283
- extras = ()
284
264
# wheel file
285
265
if link and link .is_wheel :
286
266
wheel = Wheel (link .filename ) # can raise InvalidWheelFilename
@@ -291,12 +271,12 @@ def with_source(text):
291
271
pass
292
272
293
273
return InstallRequirement (
294
- req .requirement , comes_from , link = link , markers = markers ,
274
+ req .requirement , comes_from , link = link , markers = req . markers ,
295
275
use_pep517 = use_pep517 , isolated = isolated ,
296
276
options = options if options else {},
297
277
wheel_cache = wheel_cache ,
298
278
constraint = constraint ,
299
- extras = extras ,
279
+ extras = req . extras ,
300
280
)
301
281
302
282
0 commit comments