forked from SoCo/socos
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
53 lines (43 loc) · 1.2 KB
/
Copy pathsetup.py
File metadata and controls
53 lines (43 loc) · 1.2 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
#!/usr/bin/env python
try:
from setuptools import setup
has_setuptools = True
except ImportError:
from distutils.core import setup
has_setuptools = False
import re
import os.path
dirname = os.path.dirname(os.path.abspath(__file__))
filename = os.path.join(dirname, 'socos/__init__.py')
src = open(filename).read()
metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", src))
docstrings = re.findall('"""(.*)"""', src)
PACKAGE = 'socos'
PACKAGES = [ PACKAGE ]
AUTHOR_EMAIL = metadata['author']
VERSION = metadata['version']
WEBSITE = metadata['website']
LICENSE = metadata['license']
DESCRIPTION = docstrings[0]
REQUIREMENTS = list(open('requirements.txt'))
OPTIONS = {}
if has_setuptools:
OPTIONS = {
'install_requires': REQUIREMENTS,
}
# Extract name and e-mail ("Firstname Lastname <mail@example.org>")
AUTHOR, EMAIL = re.match(r'(.*) <(.*)>', AUTHOR_EMAIL).groups()
setup(name=PACKAGE,
version=VERSION,
description=DESCRIPTION,
author=AUTHOR,
author_email=EMAIL,
license=LICENSE,
url=WEBSITE,
packages=PACKAGES,
entry_points={
'console_scripts': [
'socos = socos.runner:main',
]
},
**OPTIONS)