[tor-commits] [bridgedb/master] Remove 'git+' prefix from pip dependency URIs before passing to setup().

isis at torproject.org isis at torproject.org
Sat Jul 25 19:26:20 UTC 2015


commit bca32d2835dd396b756fc3afb30b7e8ce5c98798
Author: Isis Lovecruft <isis at torproject.org>
Date:   Tue Jun 16 04:20:42 2015 +0000

    Remove 'git+' prefix from pip dependency URIs before passing to setup().
    
    In order for Pip to install dependency from git, we need to use a URI
    like:
    
        git+https://git.torproject.org/stem.git@master#egg=stem-1.4.1-py.2.7
    
    However, setuptools will choke on the 'git+' portion of a line like
    that, so we need to remove that prefix before before adding it to the
    setuptools dependency_links.
---
 setup.py |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/setup.py b/setup.py
index 032aa10..b788a7e 100644
--- a/setup.py
+++ b/setup.py
@@ -108,7 +108,9 @@ def get_requirements():
                 line = line.strip()
                 if line.startswith('#'):
                     continue
-                elif line.startswith(
+                if line.startswith(('git+', 'hg+', 'svn+')):
+                    line = line[line.index('+') + 1:]
+                if line.startswith(
                         ('https://', 'git://', 'hg://', 'svn://')):
                     links.append(line)
                 else:





More information about the tor-commits mailing list