forked from python-injector/injector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
64 lines (51 loc) · 1.67 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
from setuptools import setup, Command
import sys
class PyTest(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
import subprocess
errno = subprocess.call([sys.executable, 'runtest.py'])
raise SystemExit(errno)
def read_injector_variable(name):
prefix = '%s = ' % (name,)
with open('injector.py') as f:
for line in f:
if line.startswith(prefix):
return line.replace(prefix, '').strip().strip("'")
raise AssertionError('variable %s not found' % (name,))
version = read_injector_variable('__version__')
version_tag = read_injector_variable('__version_tag__')
try:
import pypandoc
long_description = pypandoc.convert('README.md', 'rst')
except ImportError:
print('WARNING: Could not locate pandoc, using Markdown long_description.')
long_description = open('README.md').read()
description = long_description.splitlines()[0].strip()
setup(
name='injector',
url='http://github.com/alecthomas/injector',
download_url='http://pypi.python.org/pypi/injector',
version=version,
options=dict(egg_info=dict(tag_build=version_tag)),
description=description,
long_description=long_description,
license='BSD',
platforms=['any'],
py_modules=['injector'],
author='Alec Thomas',
author_email='alec@swapoff.org',
install_requires=[
'setuptools >= 0.6b1',
'typing',
],
cmdclass={'test': PyTest},
keywords=[
'Dependency Injection', 'DI', 'Dependency Injection framework',
'Inversion of Control', 'IoC', 'Inversion of Control container',
],
)