This repository has been archived by the owner on Jun 9, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 256
/
setup.py
executable file
·85 lines (77 loc) · 2.8 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
import os
import sys
# Monkeypatch distutils.
import setuptools
import distutils.errors
from distutils.core import setup
from distutils.extension import Extension
from distutils.log import warn
try:
from Cython.Distutils import build_ext
cmdclass = dict(build_ext=build_ext)
line_profiler_source = '_line_profiler.pyx'
except ImportError:
cmdclass = {}
line_profiler_source = '_line_profiler.c'
if not os.path.exists(line_profiler_source):
raise distutils.errors.DistutilsError("""\
You need Cython to build the line_profiler from a git checkout, or
alternatively use a release tarball from PyPI to build it without Cython.""")
else:
warn("Could not import Cython. "
"Using the available pre-generated C file.")
long_description = """\
line_profiler will profile the time individual lines of code take to execute.
The profiler is implemented in C via Cython in order to reduce the overhead of
profiling.
Also included is the script kernprof.py which can be used to conveniently
profile Python applications and scripts either with line_profiler or with the
function-level profiling tools in the Python standard library.
"""
py_modules = ['line_profiler', 'kernprof']
if sys.version_info > (3, 4):
py_modules += ['line_profiler_py35']
setup(
name = 'line_profiler',
version = '2.1.1',
author = 'Robert Kern',
author_email = '[email protected]',
description = 'Line-by-line profiler.',
long_description = long_description,
url = 'https://github.com/rkern/line_profiler',
download_url = 'https://github.com/rkern/line_profiler/tarball/2.1',
ext_modules = [
Extension('_line_profiler',
sources=[line_profiler_source, 'timers.c', 'unset_trace.c'],
depends=['python25.pxd'],
),
],
license = "BSD",
keywords = ['timing', 'timer', 'profiling', 'profiler', 'line_profiler'],
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: C",
"Programming Language :: Python",
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: Implementation :: CPython',
"Topic :: Software Development",
],
py_modules = py_modules,
entry_points = {
'console_scripts': [
'kernprof=kernprof:main',
],
},
install_requires = [
'IPython>=0.13',
],
cmdclass = cmdclass,
)