-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsetup.py
101 lines (76 loc) · 2.93 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#!/usr/bin/env python
import os
import warnings
from setuptools import setup, find_packages
from textwrap import dedent
DESCRIPTION = "Organizing numerical model experiment output"
LONG_DESCRIPTION = """\
**Experiment** is designed to make it easier to ingest and process the sort of repeated simulations with numerical models that are used in many different fields of science. Although initially designed/intended for use with climate model output archived on desk in hierarchical folders containing NetCDF_ output, it's designed to be more flexible and useful for other applications.
The core functionality of Experiment are:
1. Ingest model output that has been organized to reflect the design of the experiment which produed it
2. Use metadata to align data/output across the experimental design
3. Process data using lazy and out-of-core toolkits to simplify analysis
4. Provide multiple backends for reading datasets (hierarchical folders, databases, etc) of different datatypes (NetCDF_, CSV, binary, etc)
.. _NetCDF: http://www.unidata.ucar.edu/software/netcdf
"""
DISTNAME = "experiment"
AUTHOR = "Daniel Rothenberg"
AUTHOR_EMAIL = "[email protected]"
URL = ""
LICENSE = "MIT"
DOWNLOAD_URL = "https://github.com/darothen/experiment/"
CLASSIFIERS = [
'Development Status :: 3 - Alpha',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Intended Audience :: Science/Research',
'Programming Language :: Python',
'Programming Language :: Python :: 3.5',
'Topic :: Scientific/Engineering',
]
MAJOR = 0
MINOR = 0
MICRO = 1
VERSION = "{}.{}.{}".format(MAJOR, MINOR, MICRO)
DEV = True
# Correct versioning with git info if DEV
if DEV:
import subprocess
pipe = subprocess.Popen(
['git', "describe", "--always", "--match", "v[0-9]*"],
stdout=subprocess.PIPE)
so, err = pipe.communicate()
if pipe.returncode != 0:
# no git or something wrong with git (not in dir?)
warnings.warn("WARNING: Couldn't identify git revision, using generic version string")
VERSION += ".dev"
else:
git_rev = so.strip()
git_rev = git_rev.decode('ascii') # necessary for Python >= 3
VERSION += ".dev-{}".format(git_rev)
def _write_version_file():
fn = os.path.join(os.path.dirname(__file__), DISTNAME, 'version.py')
version_str = dedent("""
__version__ = '{}'
""")
# Write version file
with open(fn, 'w') as version_file:
version_file.write(version_str.format(VERSION))
# Write version and install
_write_version_file()
setup(
name = DISTNAME,
author = AUTHOR,
author_email = AUTHOR_EMAIL,
maintainer = AUTHOR,
maintainer_email = AUTHOR_EMAIL,
description = DESCRIPTION,
long_description = LONG_DESCRIPTION,
license = LICENSE,
url = URL,
version = VERSION,
download_url = DOWNLOAD_URL,
packages = find_packages(),
package_data = {},
classifiers = CLASSIFIERS
)