-
Notifications
You must be signed in to change notification settings - Fork 285
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved the way requirements are handled, ensuring that pip gets all…
… the information it needs.
- Loading branch information
Showing
9 changed files
with
161 additions
and
73 deletions.
There are no files selected for viewing
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 was deleted.
Oops, something went wrong.
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,12 @@ | ||
# Absolute minimal dependencies for iris | ||
# -------------------------------------- | ||
|
||
# Without these, iris won't even import. | ||
|
||
cartopy | ||
matplotlib<1.9 | ||
netcdf4 | ||
numpy | ||
pyke | ||
cf_units | ||
dask>=0.15.0 |
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,20 @@ | ||
# Dependencies for a feature complete installation | ||
# ------------------------------------------------ | ||
|
||
esmpy>=7.0;python_version<"3" #conda: esmpy>=7.0 (only python=2) | ||
gdal | ||
mo_pack | ||
nc_time_axis | ||
pandas | ||
stratify #conda: python-stratify | ||
pyugrid | ||
|
||
|
||
# Iris extensions (i.e. key tools that depend on Iris) | ||
# ---------------------------------------------------- | ||
|
||
# Note: pip can handle the circularity of these extensions, but conda will | ||
# struggle. To install these extensions, ensure iris[core] has been installed | ||
# first. | ||
|
||
iris_grib;python_version<"3" #conda: iris_grib (only python=2) |
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,72 @@ | ||
import argparse | ||
import os.path | ||
|
||
|
||
REQS_DIR = os.path.dirname(__file__) | ||
CONDA_PATTERN = '#conda:' | ||
|
||
|
||
def read_conda_reqs(fname, options): | ||
lines = [] | ||
with open(fname, 'r') as fh: | ||
for line in fh: | ||
line = line.strip() | ||
if '#conda:' in line: | ||
line_start = line.index(CONDA_PATTERN) + len(CONDA_PATTERN) | ||
line = line[line_start:].strip() | ||
if 'only python=2' in line: | ||
if 'python=2' in options: | ||
line = line.replace('(only python=2)', '') | ||
lines.append(line) | ||
else: | ||
continue | ||
else: | ||
lines.append(line) | ||
return lines | ||
|
||
|
||
def compute_requirements(requirement_names=('core', ), options=None): | ||
conda_reqs_lines = [] | ||
|
||
if 'python=2' in options: | ||
conda_reqs_lines.append('python=2.*') | ||
else: | ||
conda_reqs_lines.append('# Python 3 conda configuration') | ||
|
||
for req_name in requirement_names: | ||
fname = os.path.join(REQS_DIR, '{}.txt'.format(req_name)) | ||
if not os.path.exists(fname): | ||
raise RuntimeError('Unable to find the requirements file for {} ' | ||
'in {}'.format(req_name, fname)) | ||
conda_reqs_lines.extend(read_conda_reqs(fname, options)) | ||
conda_reqs_lines.append('') | ||
|
||
return conda_reqs_lines | ||
|
||
|
||
def main(): | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument("--verbosity", help="increase output verbosity") | ||
parser.add_argument( | ||
"--groups", nargs='*', default=[], | ||
help=("Gather requirements for these given named groups " | ||
"(as found in the requirements/ folder)")) | ||
parser.add_argument( | ||
"--py2", action="store_true", | ||
help="Build the conda requirements for a python 2 installation") | ||
|
||
args = parser.parse_args() | ||
|
||
requirement_names = args.groups | ||
requirement_names.insert(0, 'core') | ||
requirement_names.insert(0, 'setup') | ||
|
||
options = [] | ||
if args.py2: | ||
options.append('python=2') | ||
|
||
print('\n'.join(compute_requirements(requirement_names, options))) | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
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 @@ | ||
# Dependencies necessary to run setup.py of iris | ||
# ---------------------------------------------- | ||
|
||
setuptools | ||
numpy |
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,9 @@ | ||
# Dependencies needed to run the iris tests | ||
#------------------------------------------ | ||
|
||
mock | ||
nose | ||
pep8 | ||
filelock | ||
imagehash | ||
requests |
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