40
40
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
41
41
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
42
42
43
- # Hack to prevent stupid "TypeError: 'NoneType' object is not callable" error
44
- # in multiprocessing/util.py _exit_function when running `python
45
- # setup.py test` (see
46
- # http://www.eby-sarna.com/pipermail/peak/2010-May/003357.html)
47
- for m in ("multiprocessing" , "billiard" ):
48
- try :
49
- __import__ (m )
50
- except ImportError :
51
- pass
52
-
53
43
import ast
54
44
import codecs
55
45
import os
56
- import sys
57
- from distutils .command .build_ext import build_ext
58
- from distutils .errors import CCompilerError , DistutilsExecError , DistutilsPlatformError
59
46
60
47
import pkg_resources
61
- from setuptools import Extension , setup
62
- from setuptools .command .test import test as TestCommand
48
+ from setuptools import setup
63
49
64
50
pkg_resources .require ("setuptools>=39.2" )
65
51
66
52
67
- class PyTest (TestCommand ):
68
- user_options = [("pytest-args=" , "a" , "Arguments to pass to py.test" )]
69
-
70
- def initialize_options (self ) -> None :
71
- TestCommand .initialize_options (self )
72
- self .pytest_args = []
73
-
74
- def finalize_options (self ) -> None :
75
- TestCommand .finalize_options (self )
76
- self .test_args = []
77
- self .test_suite = True
78
-
79
- def run_tests (self ) -> None :
80
- # import here, cause outside the eggs aren't loaded
81
- import pytest
82
-
83
- errno = pytest .main (self .pytest_args )
84
- sys .exit (errno )
85
-
86
-
87
53
def get_version ():
88
54
"""
89
55
Get version without importing from elasticapm. This avoids any side effects
@@ -108,4 +74,4 @@ def get_version():
108
74
return "unknown"
109
75
110
76
111
- setup (cmdclass = { "test" : PyTest }, version = get_version ())
77
+ setup (version = get_version ())
0 commit comments