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
|
#!/usr/bin/env python
import io
import os
import sys
from setuptools import setup
from distutils.core import Extension
from distutils.ccompiler import new_compiler
with open('README.md', encoding='UTF-8') as f:
long_description = f.read()
HOMEPAGE = "https://github.com/sumerc/yappi"
NAME = "yappi"
VERSION = "1.6.10"
_DEBUG = False # compile/link code for debugging
_PROFILE = False # profile yappi itself
user_macros = []
user_libraries = []
compile_args = []
link_args = []
if os.name == 'posix' and sys.platform != 'darwin':
compiler = new_compiler()
if compiler.has_function('timer_create', libraries=('rt', )):
user_macros.append(('LIB_RT_AVAILABLE', '1'))
user_libraries.append('rt')
if _DEBUG:
if os.name == 'posix':
compile_args.append('-g')
compile_args.append('-O0')
elif os.name == 'nt':
compile_args.append('/Zi')
link_args.append('/DEBUG')
if _PROFILE:
# Link with cpu profiler to allow profiling yappi itself
# http://google-perftools.googlecode.com/svn/trunk/doc/cpuprofile.html
user_libraries.append('profiler')
#user_macros.append(('DEBUG_MEM', '1')),
#user_macros.append(('DEBUG_CALL', '1'))
#user_macros.append(('YDEBUG', '1')),
CLASSIFIERS = [
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: Implementation :: CPython',
'Operating System :: OS Independent',
'Topic :: Software Development :: Libraries',
'Topic :: Software Development :: Libraries :: Python Modules',
]
test_deps = ['gevent>=20.6.2']
setup(
name=NAME,
version=VERSION,
author="Sümer Cip",
author_email="sumerc@gmail.com",
ext_modules=[
Extension(
"_yappi",
sources=[
"yappi/_yappi.c", "yappi/callstack.c", "yappi/hashtab.c",
"yappi/mem.c", "yappi/freelist.c", "yappi/timing.c",
"yappi/tls.c"
],
define_macros=user_macros,
libraries=user_libraries,
extra_compile_args=compile_args,
extra_link_args=link_args
)
],
package_dir={'': 'yappi'},
py_modules=["yappi"],
entry_points={
'console_scripts': [
'yappi = yappi:main',
],
},
description="Yet Another Python Profiler",
long_description=long_description,
long_description_content_type='text/markdown',
keywords="python thread multithread asyncio gevent profiler",
python_requires='>=3.6',
classifiers=CLASSIFIERS,
license="MIT",
url=HOMEPAGE,
extras_require={
'test': test_deps,
}
)
|