-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
135 lines (116 loc) · 3.78 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# -*- coding: utf-8 -*-
#------------------------------------------------------------------------------
# file: setup.py
# License: LICENSE.TXT
#
# Copyright (c) 2011-2014, Enthought, Inc.
# All rights reserved.
#------------------------------------------------------------------------------
import os
import platform
from setuptools import setup, find_packages, Extension, Feature
try:
from Cython.Distutils import build_ext
except ImportError:
CAN_BUILD_CYTHON_MONITORS = False
cmdclass = {}
else:
CAN_BUILD_CYTHON_MONITORS = platform.python_implementation() == 'CPython'
cmdclass = {'build_ext': build_ext}
try:
import unittest2
except ImportError:
test_suite = 'pikos.tests'
else:
test_suite = 'unittest2.collector'
with open('README.rst', 'r') as readme:
README_TEXT = readme.read()
real_time_lsprof = Feature(
description='optional real time lsrof using zmq',
standard=False,
ext_modules=[
Extension(
'pikos._internal._lsprof_rt',
sources=['pikos/_internal/_lsprof_rt.c',
'pikos/_internal/rotatingtree.c'],
libraries=['zmq'],
),
]
)
features = {'real-time-lsprof': real_time_lsprof}
cython_monitors = Feature(
description='optional compile additional cython monitors',
standard=CAN_BUILD_CYTHON_MONITORS,
ext_modules=[
Extension(
'pikos.cymonitors.monitor',
sources=['pikos/cymonitors/monitor.pyx']),
Extension(
'pikos.cymonitors.function_monitor',
sources=[
'pikos/cymonitors/function_monitor.pyx']),
Extension(
'pikos.cymonitors.line_monitor',
sources=[
'pikos/cymonitors/line_monitor.pyx']),
Extension(
'pikos.cymonitors.focused_function_monitor',
sources=[
'pikos/cymonitors/focused_function_monitor.pyx']),
Extension(
'pikos.cymonitors.focused_line_monitor',
sources=[
'pikos/cymonitors/focused_line_monitor.pyx']),
Extension(
'pikos.cymonitors.function_memory_monitor',
sources=[
'pikos/cymonitors/function_memory_monitor.pyx']),
Extension(
'pikos.cymonitors.focused_function_memory_monitor',
sources=[
'pikos/cymonitors/focused_function_memory_monitor.pyx']),
Extension(
'pikos.cymonitors.line_memory_monitor',
sources=[
'pikos/cymonitors/line_memory_monitor.pyx']),
Extension(
'pikos.cymonitors.focused_line_memory_monitor',
sources=[
'pikos/cymonitors/focused_line_memory_monitor.pyx'])])
features['cython-monitors'] = cython_monitors
VERSION = '0.2.0dev'
def write_version_py(filename=None):
if filename is None:
filename = os.path.join(
os.path.dirname(__file__), 'pikos', 'version.py')
ver = """\
# -*- coding: utf-8 -*-
#------------------------------------------------------------------------------
# Package: Pikos toolkit
# File: version.py
# License: LICENSE.TXT
#
# Copyright (c) 2012-14, Enthought, Inc.
# All rights reserved.
#------------------------------------------------------------------------------
version = '%s'
"""
fh = open(filename, 'wb')
try:
fh.write(ver % VERSION)
finally:
fh.close()
write_version_py()
setup(
name='pikos',
version=VERSION,
author='Enthought Inc',
author_email='info@enthought.com',
description='Enthought monitoring and profiling tools',
long_description=README_TEXT,
packages=find_packages(),
test_suite=test_suite,
entry_points=dict(
console_scripts=['pikos-run = pikos.runner:main']),
cmdclass=cmdclass,
features=features)