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
61 lines (48 loc) · 1.45 KB
/
setup.py
File metadata and controls
61 lines (48 loc) · 1.45 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
#!/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())
setup(
name="conform",
author="Sheri Mickelson",
author_email="mickelson@ucar.edu",
packages=['conform'],
version=get_version(),
scripts=['conform/cesm_conform_generator.py','conform/cesm_conform_initialize.py','conform/cesm_extras'],
install_requires=get_requires(),
include_package_data=True,
zip_safe=True,
test_suite="conform.tests",
description="CESM Python Experiment Conform Tool.",
use_2to3=True,
requires=['pyconform']
)