-
Notifications
You must be signed in to change notification settings - Fork 95
/
setup.py
46 lines (39 loc) · 1.13 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
#!/usr/bin/python
from __future__ import print_function
import os
import sys
import re
import os.path as op
from setuptools import find_packages, setup
# change directory to this module path
try:
this_file = __file__
except NameError:
this_file = sys.argv[0]
this_file = os.path.abspath(this_file)
if op.dirname(this_file):
os.chdir(op.dirname(this_file))
script_dir = os.getcwd()
def readme(fname):
"""Read text out of a file in the same directory as setup.py.
"""
return open(op.join(script_dir, fname)).read()
def find_version(fname):
version_file = readme(fname)
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
version_file, re.M)
if version_match:
return version_match.group(1)
raise RuntimeError("Unable to find version string.")
setup(
name="metro",
version=find_version("metro/__init__.py"),
description="METRO",
long_description=readme('README.md'),
packages=find_packages(),
classifiers=[
'Intended Audience :: Developers',
"Programming Language :: Python",
'Topic :: Software Development',
]
)