-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #181 from MetOffice/feature_setuppy_i174
add requirements directory and setup.py now use requirement.txt #174
- Loading branch information
Showing
4 changed files
with
59 additions
and
9 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# file contains the list of required libraries for pip build | ||
numpy | ||
matplotlib | ||
six | ||
scipy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import os | ||
|
||
|
||
|
||
PACKAGE_DIR = os.path.abspath(os.path.dirname(__file__)) | ||
|
||
|
||
|
||
|
||
|
||
def pip_requirements(*args): | ||
requirements = [] | ||
for name in args: | ||
fname = os.path.join( | ||
PACKAGE_DIR, "requirements", "{}.txt".format(name) | ||
) | ||
if not os.path.exists(fname): | ||
emsg = ( | ||
f"Unable to find the {name!r} requirements file at {fname!r}." | ||
) | ||
raise RuntimeError(emsg) | ||
with open(fname, "r") as fh: | ||
for line in fh: | ||
line = line.strip() | ||
if not line or line.startswith("#"): | ||
continue | ||
requirements.append(line) | ||
return requirements | ||
|
||
|
||
req = pip_requirements("requirements") | ||
print(req) |