summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAurélien Bompard <aurelien@bompard.org>2013-08-30 18:07:40 +0200
committerAurélien Bompard <aurelien@bompard.org>2013-08-30 18:09:07 +0200
commited0b01dd362f2def142cf2128aac844f09ee4fdc (patch)
tree6561049cccb54618825db06a1b4d43c2304f5c94
parentcecb1df56dbc8ead811b155c4268ccad1c0b82f1 (diff)
downloadhyperkitty-ed0b01dd362f2def142cf2128aac844f09ee4fdc.tar.gz
hyperkitty-ed0b01dd362f2def142cf2128aac844f09ee4fdc.tar.xz
hyperkitty-ed0b01dd362f2def142cf2128aac844f09ee4fdc.zip
Strip pip syntax from the requirements file
-rwxr-xr-xsetup.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/setup.py b/setup.py
index 93a79c1..afc2bb8 100755
--- a/setup.py
+++ b/setup.py
@@ -6,16 +6,19 @@ use_setuptools()
from setuptools import setup, find_packages
-def filetolist(filepath):
+def reqfile(filepath):
"""Turns a text file into a list (one element per line)"""
result = []
+ import re
+ url_re = re.compile(".+:.+#egg=(.+)")
with open(filepath, "r") as f:
for line in f:
- if "#" in line:
- line = line[:line.index("#")]
line = line.strip()
- if not line:
+ if not line or line.startswith("#"):
continue
+ mo = url_re.match(line)
+ if mo is not None:
+ line = mo.group(1)
result.append(line)
return result
@@ -41,5 +44,5 @@ setup(
#packages=find_packages(exclude=["*.test", "test", "*.test.*"]),
packages=find_packages(),
include_package_data=True,
- install_requires=filetolist('requirements.txt'),
+ install_requires=reqfile("requirements.txt"),
)