setup.py to work without requirements.txt

Change-Id: Ib88f3930947191d290f8d567b8995afae6950952
This commit is contained in:
Dmitry Tantsur 2015-02-24 09:54:02 +01:00
parent f85d1ca41d
commit 9f18e11480
1 changed files with 8 additions and 3 deletions

View File

@ -3,9 +3,14 @@ import re
from setuptools import setup
with open('requirements.txt', 'r') as fp:
install_requires = [re.split(r'[<>=]', line)[0]
for line in fp if line.strip()]
try:
# Distributions have to delete *requirements.txt
with open('requirements.txt', 'r') as fp:
install_requires = [re.split(r'[<>=]', line)[0]
for line in fp if line.strip()]
except EnvironmentError:
print("No requirements.txt, not handling dependencies")
install_requires = []
with open('ironic_discoverd/__init__.py', 'rb') as fp: