@@ -198,9 +198,17 @@ def handle_requirements_file(project_dir, requirements_file):
198
198
requirements_line .startswith ("-e hg+" ):
199
199
pass
200
200
elif requirements_line .startswith ("-e" ):
201
+ requirements_line = requirements_line .strip ()[3 :]
201
202
try :
202
203
tmp_path , egg = requirements_line .strip ().split ('#' )
203
204
tmp_name = egg .split ('egg=' )[1 ]
205
+ _tmp = tmp_path .split ('[' )
206
+ if len (_tmp ) > 1 :
207
+ tmp_path = _tmp [0 ]
208
+ tmp_other = '[' + _tmp [1 ]
209
+ else :
210
+ tmp_path = _tmp
211
+ tmp_other = ''
204
212
except :
205
213
raise click .ClickException (
206
214
"Requirement starting with `.` "
@@ -211,11 +219,11 @@ def handle_requirements_file(project_dir, requirements_file):
211
219
tmp_path = os .path .abspath (os .path .join (
212
220
os .path .dirname (requirements_file ),
213
221
os .path .abspath (os .path .join (
214
- current_dir , tmp_path . strip ()[ 3 :]
222
+ current_dir , tmp_path
215
223
)),
216
224
))
217
225
218
- requirements_line = "-e %s" % tmp_path
226
+ requirements_line = "-e %s%s " % ( tmp_path , tmp_other )
219
227
sources [tmp_name ] = dict (url = tmp_path , type = 'path' )
220
228
221
229
elif requirements_line .startswith ("-r ./" ):
@@ -262,7 +270,7 @@ def handle_requirements_file(project_dir, requirements_file):
262
270
editable_file = os .path .join (project_dir , 'editable.txt' )
263
271
with open (editable_file , 'w+' ) as f :
264
272
for item in editable :
265
- item_path = item .split ('#' )[0 ]
273
+ item_path = item .split ('[' )[ 0 ]. split ( ' #' )[0 ]
266
274
if item_path .startswith ('.' ):
267
275
item_path = os .path .abspath (os .path .join (current_dir , item_path )) # noqa
268
276
if os .path .isdir (item_path ):
0 commit comments