[tor-commits] [oonib/master] Fix indendation of setup.py

isis at torproject.org isis at torproject.org
Sat May 4 16:10:29 UTC 2013


commit 59bba75c9934eb52cf516c8a6d05d953b9c73590
Author: Arturo Filastò <art at fuffa.org>
Date:   Sat May 4 16:41:42 2013 +0200

    Fix indendation of setup.py
    
    Skip comments and requirements directives
---
 setup.py |   34 ++++++++++++++++++----------------
 1 files changed, 18 insertions(+), 16 deletions(-)

diff --git a/setup.py b/setup.py
index 6151a72..45a7908 100644
--- a/setup.py
+++ b/setup.py
@@ -2,24 +2,26 @@ from __future__ import with_statement
 from setuptools import setup, find_packages
 
 def get_requirements():
-   with open('requirements.txt', 'r') as f:
-       requirements = f.read().splitlines()
+    with open('requirements.txt', 'r') as f:
+        requirements = f.read().splitlines()
 
-   # For urls such as https://hg.secdev.org/scapy/archive/tip.zip#egg=scapy in
-   # requirements.txt we need to add the package name to install_requires and
-   # the entire url to dependency_links. That way setuptools will be able to
-   # satisfy the dependency using that url (as long as it is in standard sdist
-   # format, a single .py file or an egg).
-   pypi_packages = []
-   dependency_links = []
-   for package_desc in requirements:
-       if '#egg=' in package_desc:
-           dependency_links.append(package_desc)
-           pypi_packages.append(package_desc.split('#egg=')[-1])
-       else:
-           pypi_packages.append(package_desc)
+    # For urls such as https://hg.secdev.org/scapy/archive/tip.zip#egg=scapy in
+    # requirements.txt we need to add the package name to install_requires and
+    # the entire url to dependency_links. That way setuptools will be able to
+    # satisfy the dependency using that url (as long as it is in standard sdist
+    # format, a single .py file or an egg).
+    pypi_packages = []
+    dependency_links = []
+    for package_desc in requirements:
+        if package_desc.startswith("#") or package_desc.startswith("-i"):
+            continue
+        if '#egg=' in package_desc:
+            dependency_links.append(package_desc)
+            pypi_packages.append(package_desc.split('#egg=')[-1])
+        else:
+            pypi_packages.append(package_desc)
 
-   return pypi_packages, dependency_links
+    return pypi_packages, dependency_links
 
 install_requires, dependency_links = get_requirements()
 setup(





More information about the tor-commits mailing list