@@ -296,7 +296,7 @@ def process_wheel(wheel_cache_dir, wheel, sources, verbose, index=INDEX_URL,
296296 release ['hash_type' ] = 'sha256'
297297
298298 if release ['url' ].startswith ('http://' ) or release ['url' ].startswith ('https://' ):
299-
299+
300300 release ['fetch_type' ] = 'fetchurl'
301301
302302 r = requests .get (release ['url' ], stream = True , timeout = None )
@@ -310,9 +310,15 @@ def process_wheel(wheel_cache_dir, wheel, sources, verbose, index=INDEX_URL,
310310
311311 release ['hash_value' ] = hash .hexdigest ()
312312 elif release ['url' ].startswith ('git' ):
313+ revision = ''
314+ if release ['url' ].startswith ('git+' ):
315+ release ['url' ] = release ['url' ][4 :]
316+ if '@' in release ['url' ]:
317+ release ['url' ], revision = release ['url' ].split ('@' )
313318 release ['fetch_type' ] = 'fetchgit'
314- command = 'nix-prefetch-git {url}' .format (
315- ** release
319+ command = 'nix-prefetch-git {url} {revision}' .format (
320+ url = release ['url' ],
321+ revision = revision
316322 )
317323 return_code , output = cmd (command , verbose != 0 )
318324 if return_code != 0 :
@@ -365,12 +371,14 @@ def main(verbose, wheels, requirements_files, wheel_cache_dir, index=INDEX_URL):
365371 lines = f .readlines ()
366372 for line in lines :
367373 line = line .strip ()
374+ if line .startswith ('-e ' ):
375+ line = line [3 :]
368376 if line .startswith ('http://' ) or line .startswith ('https://' ) or \
369- line .startswith ('-e git+' ):
377+ line .startswith ('git+' ):
370378 try :
371379 url , egg = line .split ('#' )
372380 name = egg .split ('egg=' )[1 ]
373- sources [name ] = url . replace ( '-e git+' , '' )
381+ sources [name ] = url
374382 except :
375383 raise click .ClickException (
376384 "Requirement starting with http:// or https:// "
0 commit comments