forked from manmeet3591/python_class
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
62 lines (49 loc) · 1.56 KB
/
setup.py
File metadata and controls
62 lines (49 loc) · 1.56 KB
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
#!/usr/bin/env python
#
# based on template example from:
# https://github.com/hcarvalhoalves/python-package-template
#
from setuptools import setup, find_packages
import sys
import os
BASE_LOCATION = os.path.abspath(os.path.dirname(__file__))
VERSION_FILE = 'VERSION'
REQUIRES_FILE = 'requirements.txt'
DEPENDENCIES_FILE = 'requirements_links.txt'
def readfile(filename, func):
try:
with open(os.path.join(BASE_LOCATION, filename)) as f:
data = func(f)
except (IOError, IndexError):
sys.stderr.write(u"""
Unable to open file: {0}
For development run:
make version
setup.py develop
To build a valid release, run:
make release
""".format(filename))
sys.exit(1)
return data
def get_version():
return readfile(VERSION_FILE, lambda f: f.read().strip())
def get_requires():
return readfile(REQUIRES_FILE, lambda f: f.read().strip())
def get_dependencies():
return readfile(DEPENDENCIES_FILE, lambda f: f.read().strip())
print('cesm_utils version = '+ get_version())
setup(
name="cesm_utils",
author="Alice Bertini",
author_email="aliceb@ucar.edu",
packages=['cesm_utils'],
version=get_version(),
scripts=['cesm_utils/module_check', 'cesm_utils/create_postprocess','cesm_utils/create_ocn_za', 'cesm_utils/create_f2py_remap', 'cesm_utils/get_machine'],
#install_requires=get_requires(),
#dependency_links=get_dependencies(),
include_package_data=True,
zip_safe=True,
test_suite="cesm_utils.tests",
description="CESM CASEROOT post-processing utilities.",
use_2to3=True,
)