forked from MPAS-Dev/compass
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
82 lines (72 loc) · 2.79 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/usr/bin/env python
import os
import re
from setuptools import setup, find_packages
def package_files(directory, prefixes, extensions):
""" based on https://stackoverflow.com/a/36693250/7728169"""
paths = []
for (path, directories, filenames) in os.walk(directory):
for filename in filenames:
parts = filename.split('.')
prefix = parts[0]
extension = parts[-1]
if prefix in prefixes or extension in extensions:
paths.append(os.path.join('..', path, filename))
return paths
install_requires = \
['cartopy',
'cmocean',
'ipython',
'jigsawpy==0.3.3',
'jupyter',
'lxml',
'matplotlib',
'netcdf4',
'numpy',
'progressbar2',
'pyamg',
'requests',
'scipy',
'shapely',
'xarray']
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, 'compass', '__init__.py')) as f:
init_file = f.read()
version = re.search(r'{}\s*=\s*[(]([^)]*)[)]'.format('__version_info__'),
init_file).group(1).replace(', ', '.')
os.chdir(here)
data_files = package_files('compass',
prefixes=['namelist', 'streams', 'README'],
extensions=['cfg', 'template', 'json', 'txt',
'geojson', 'mat'])
setup(name='compass',
version=version,
description='Configuration Of Model for Prediction Across Scales '
'Setups (COMPASS) is an automated system to set up test '
'cases that match the MPAS-Model repository. All '
'namelists and streams files begin with the default '
'generated from the Registry.xml file, and only the '
'changes relevant to the particular test case are altered '
'in those files.',
url='https://github.com/MPAS-Dev/MPAS-Tools',
author='COMPASS Developers',
author_email='[email protected]',
license='BSD',
classifiers=[
'Development Status :: 4 - Beta',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Intended Audience :: Science/Research',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Topic :: Scientific/Engineering',
],
packages=find_packages(include=['compass', 'compass.*']),
package_data={'': data_files},
install_requires=install_requires,
entry_points={'console_scripts':
['compass = compass.__main__:main']})