-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
executable file
·37 lines (33 loc) · 1.02 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
#!/usr/bin/env python
from distutils.core import setup
import subprocess, os
mod = __import__('mgutenberg')
version = mod.__version__
if 'dev' in version:
if os.path.exists('.hg'):
def hg(args):
out = subprocess.Popen(['hg'] + args, stdout=subprocess.PIPE)
return out.communicate()[0]
try:
cur_id = hg(["id"]).split()[0]
v = hg(["log", "--template={rev}.{node|short}",
"-r", cur_id.replace('+', '')])
if '+' in cur_id:
v = v.replace('.', 'x.')
v = "." + v
except OSError:
v = ""
version += v
setup(
name = 'mgutenberg',
version = version,
author = "Pauli Virtanen",
author_email = "pav@iki.fi",
license = "BSD, 3-clause",
##
packages = ['mgutenberg'],
package_data={'mgutenberg': ['doc/*.html', 'doc/*.css', 'doc/*.png',
'doc/*.gif']},
scripts = ["mgutenberg/mgutenberg"],
test_suite = 'nose.collector',
)