From 06db89cf13b4c5da0b9166de8422dde5af4ffdcc Mon Sep 17 00:00:00 2001 From: Colin Jermain Date: Mon, 13 Apr 2020 18:45:27 -0400 Subject: [PATCH] Using logic for finding README.rst to find requirements.txt --- setup.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 87180cff61..c0ab3d8bec 100644 --- a/setup.py +++ b/setup.py @@ -201,7 +201,13 @@ if bdist_wheel is not None : cmd_classes['bdist_wheel'] = bdist_wheel cmd_classes['build_ext'] = build_ext -with open('requirements.txt') as f: +requirements_path = path.join(getcwd(), "requirements.txt") +if not path.exists(requirements_path): + this = path.dirname(__file__) + requirements_path = path.join(this, "requirements.txt") +if not path.exists(requirements_path): + raise FileNotFoundError("Unable to find 'requirements.txt'") +with open(requirements_path) as f: install_requires = f.read().splitlines() # Setup