forked from pycontribs/tendo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·109 lines (96 loc) · 3.42 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#!/usr/bin/env python
# Setuptools is required for the use_2to3 option below. You should install it
# from the Distribute home page, http://packages.python.org/distribute/
import inspect
import logging
import os
import sys
from setuptools import setup, Command
from setuptools.command.test import test as TestCommand
#from distutils.core import setup, Command
from tendo import __version__
# Hack to prevent stupid "TypeError: 'NoneType' object is not callable" error
# in multiprocessing/util.py _exit_function when running `python
# setup.py test` (see
# http://www.eby-sarna.com/pipermail/peak/2010-May/003357.html)
try:
import multiprocessing
except ImportError:
pass
test_requirements = ['pep8>=0.6', 'py', 'pytest', 'six', 'sphinx'] # 'nosexcover']
test_suite = "py.test"
if sys.hexversion >= 0x02060000:
#requirements.extend(['nose-machineout'])
test_suite = "py.test"
# handle python 3
if sys.version_info >= (3,):
use_2to3 = True
else:
use_2to3 = False
options = {}
#class PyTest(Command):
# user_options = []
# def initialize_options(self):
# pass
# def finalize_options(self):
# pass
# def run(self):
# import sys,subprocess
# errno = subprocess.call([sys.executable, 'tox'])
# raise SystemExit(errno)
"""
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
#import here, cause outside the eggs aren't loaded
import pytest
pytest.main(self.test_args)
"""
class Tox(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
#import here, cause outside the eggs aren't loaded
import tox
errno = tox.cmdline(self.test_args)
sys.exit(errno)
setup(
name='tendo',
py_modules=['tendo.colorer', 'tendo.execfile2', 'tendo.singleton', 'tendo.tee', 'tendo.unicode'],
packages=['tendo'],
version=__version__,
zip_safe=False,
description='A Python library that extends some core functionality',
author='Sorin Sbarnea',
author_email='[email protected]',
url='https://github.com/pycontribs/tendo',
download_url='https://github.com/pycontribs/tendo/archives/master',
keywords=['tendo', 'tee', 'unicode', 'colorer', 'singleton'],
classifiers=[
'Programming Language :: Python',
'Programming Language :: Python :: 2.5',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Development Status :: 4 - Beta',
'Environment :: Other Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Internet',
],
long_description=open('README.md').read(),
setup_requires=['six', 'tox'], # ,'nosexcover'],
tests_require=test_requirements, # autopep8 removed because it does not install on python2.5
test_suite=test_suite,
cmdclass={'test': Tox},
# use_2to3 = use_2to3,
**options
)