forked from pinpoint-apm/pinpoint-c-agent
-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup_pypi_test.py
58 lines (50 loc) · 1.76 KB
/
setup_pypi_test.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
from setuptools import setup, Extension, find_namespace_packages
import platform
from pathlib import Path
with open("README", "r") as fh:
long_description = fh.read()
name = platform.system().lower()
agent_libraries = []
extra_compile_args_ = []
if name == 'windows':
pass
elif name == 'darwin':
agent_libraries = ['stdc++']
extra_compile_args_.append("-std=c++11")
elif name == 'linux':
agent_libraries = ['rt', 'stdc++']
extra_compile_args_.append("-std=c++11")
else:
raise RuntimeError('Unknown platform to us: ' + name)
###############################################
extFiles = [
'src/PY/_pinpoint_py.cpp',
]
# add pinpoint-common
for a_file in Path("common/src").glob('**/*.cpp'):
extFiles.append(str(a_file))
for a_file in Path("common/jsoncpp").glob('**/*.cpp'):
extFiles.append(str(a_file))
cwd = Path.cwd()
include_dirs_ = [Path(cwd, './common/include'), Path(cwd, './common/jsoncpp/include'),
Path(cwd, './common/src')]
setup(name='pinpointPy',
version="1.3.6", # don't forget update __version__ in pinpointPy/__init__.py
author="cd_pinpoint members",
author_email='[email protected]',
license='Apache License 2.0',
url="https://github.com/pinpoint-apm/pinpoint-c-agent",
long_description=long_description,
long_description_content_type='text/markdown',
ext_modules=[
Extension('_pinpointPy',
extFiles,
include_dirs=include_dirs_,
libraries=agent_libraries,
extra_compile_args=extra_compile_args_
)
],
package_dir={'': 'plugins/PY'},
packages=find_namespace_packages(
'plugins/PY', include=['pinpointPy.*', 'pinpointPy']),
)