-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
58 lines (43 loc) · 1.27 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
from setuptools import find_packages, setup
try: # for pip >= 10
from pip._internal.req import parse_requirements
except ImportError: # for pip <= 9.0.3
from pip.req import parse_requirements
def get_meta():
mod_locals = {}
with open('./gae/__about__.py') as about_file:
exec(
about_file.read(),
mod_locals,
mod_locals,
)
return dict(
(k, v) for k, v in mod_locals.items() if k in mod_locals['__all__']
)
def get_requirements(filename):
try:
from pip._internal.download import PipSession
session = PipSession()
except ImportError:
session = None
reqs = parse_requirements(filename, session=session)
return [str(r.req) for r in reqs]
meta = get_meta()
setup_args = dict(
name='gae-utils',
version=meta['version'],
maintainer=meta['maintainer'],
maintainer_email=meta['maintainer_email'],
description=meta['description'],
url=meta['url'],
packages=find_packages(),
namespace_packages=['gae'],
install_requires=get_requirements('requirements.txt'),
entry_points={
'console_scripts': [
'gae-link-libs = gae.link_libs.__main__:main',
]
},
)
if __name__ == '__main__':
setup(**setup_args)