-
Notifications
You must be signed in to change notification settings - Fork 3
/
setup.py
73 lines (53 loc) · 1.85 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
"""PyAsy setup script."""
import glob
import os
import re
try:
from setuptools import setup
except:
from distutils.core import setup
######################################################################
# version
execfile('version.py') # this sets 'version'
######################################################################
# save git version to 'pyasy/__git_version__.py'
try:
git_head_file = os.path.join(os.path.dirname(__file__), '.git', 'HEAD')
f = open(git_head_file)
m = re.match(r'ref: (.+)', f.readline())
ref = m.group(1)
f.close()
git_head_file = os.path.join(os.path.dirname(__file__), '.git', ref)
f = open(git_head_file)
git_version = f.readline().rstrip()
f.close()
except:
git_version = 'not_available'
git_version_file = os.path.join(os.path.dirname(__file__),
'pyasy','__git_version__.py')
f = open(git_version_file, 'w')
f.write("version = '%s'\n" % (git_version))
f.close()
######################################################################
# save version to 'pyasy/__version__.py'
version_file = os.path.join(os.path.dirname(__file__),
'pyasy','__version__.py')
f = open(version_file, 'w')
f.write("version = '%s'\n" % (version))
f.close()
######################################################################
# setup!
setup(
name = "PyAsy",
version = version,
packages = ['pyasy'],
zip_safe = False,
package_data = {'': ['__version__.py', '__git_version__.py']},
exclude_package_data = {'': ['.gitignore']},
author = "Matthew Emmett",
author_email = "[email protected]",
description = "PyAsy is a Python wrapper of the Asymptote vector graphics language.",
license = "BSD",
keywords = "vector, graphics, asymptote",
url = "http://github.com/memmett/PyAsy"
)