forked from diffpy/diffpy.utils
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
executable file
·69 lines (60 loc) · 2.06 KB
/
setup.py
File metadata and controls
executable file
·69 lines (60 loc) · 2.06 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
63
64
65
66
67
68
69
#!/usr/bin/env python
"""utils - small shared utilities for other diffpy packages
Packages: diffpy.utils
"""
import os
from setuptools import setup, find_packages
def gitversion():
from subprocess import Popen, PIPE
proc = Popen(['git', 'describe'], stdout=PIPE)
desc = proc.stdout.read().strip()
proc = Popen(['git', 'log', '-1', '--format=%ai'], stdout=PIPE)
isodate = proc.stdout.read()
date = isodate.split()[0].replace('-', '')
rv = desc + '-' + date
return rv
def getsetupcfg():
cfgfile = 'setup.cfg'
from ConfigParser import SafeConfigParser
cp = SafeConfigParser()
cp.read(cfgfile)
if not os.path.isdir('.git'): return cp
d = cp.defaults()
vcfg = d.get('version', '')
vgit = gitversion()
if vgit != vcfg:
cp.set('DEFAULT', 'version', vgit)
cp.write(open(cfgfile, 'w'))
return cp
cp = getsetupcfg()
# define distribution
setup(
name = "diffpy.utils",
version = cp.get('DEFAULT', 'version'),
namespace_packages = ['diffpy'],
packages = find_packages(),
test_suite = 'diffpy.utils.tests',
include_package_data = True,
author = 'Simon J.L. Billinge',
author_email = 'sb2896@columbia.edu',
maintainer = 'Pavol Juhas',
maintainer_email = 'pj2192@columbia.edu',
url = 'http://www.diffpy.org/',
download_url = 'http://www.diffpy.org/packages/',
description = "Utilities for diffpy",
license = 'BSD',
keywords = "diffpy utilities",
classifiers = [
# List of possible values at
# http://pypi.python.org/pypi?:action=list_classifiers
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Intended Audience :: Science/Research',
'Operating System :: MacOS',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX',
'Programming Language :: Python :: 2.5',
'Topic :: Scientific/Engineering :: Physics',
],
)
# End of file