From 9f18e11480cf64f3138a04e94c5bd64aaf90529d Mon Sep 17 00:00:00 2001 From: Dmitry Tantsur Date: Tue, 24 Feb 2015 09:54:02 +0100 Subject: [PATCH] setup.py to work without requirements.txt Change-Id: Ib88f3930947191d290f8d567b8995afae6950952 --- setup.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 35f19df8e..b8b59bbf7 100644 --- a/setup.py +++ b/setup.py @@ -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: