This repository has been archived by the owner on Feb 21, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
setup.py
61 lines (50 loc) · 1.73 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
from os import path
from setuptools import setup
CLASSIFIERS = [
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Utilities',
'Topic :: Software Development :: Libraries :: Python Modules']
def extract_version(filepath='jeni.py', name='__version__'):
"""Parse __version__ out of given Python file.
Given jeni.py has dependencies, `from jeni import __version__` will fail.
"""
context = {}
for line in open(filepath):
if name in line:
exec(line, context)
break
else:
raise RuntimeError('{} not found in {}'.format(name, filepath))
return context[name]
README = 'README.txt'
if not path.exists(README):
README = 'README.rst'
with open(path.join(path.dirname(__file__), README)) as fd:
long_description = '\n' + fd.read()
setup(
name='jeni',
version=extract_version(),
url='https://github.com/rduplain/jeni-python',
license='BSD',
author='Ron DuPlain',
author_email='[email protected]',
description='jeni injects annotated dependencies',
long_description=long_description,
py_modules=['jeni'],
install_requires=[
'six',
],
classifiers=CLASSIFIERS)