|
5 | 5 | from scorep.instrumenter import has_c_instrumenter |
6 | 6 |
|
7 | 7 | if scorep.helper.get_scorep_version() < 5.0: |
8 | | - raise RuntimeError( |
9 | | - "Score-P version less than 5.0, plase use Score-P >= 5.0") |
| 8 | + raise RuntimeError("Score-P version less than 5.0, plase use Score-P >= 5.0") |
10 | 9 |
|
11 | 10 | link_mode = scorep.helper.get_scorep_config("Link mode:") |
12 | 11 | if not ("shared=yes" in link_mode): |
13 | 12 | raise RuntimeError( |
14 | | - "Score-P not build with \"--enable-shared\". Link mode is:\n{}".format(link_mode)) |
| 13 | + 'Score-P not build with "--enable-shared". Link mode is:\n{}'.format(link_mode) |
| 14 | + ) |
15 | 15 |
|
16 | 16 | check_compiler = scorep.helper.get_scorep_config("C99 compiler used:") |
17 | 17 | if "gcc" in check_compiler: |
18 | 18 | gcc_plugin = scorep.helper.get_scorep_config("GCC plug-in support:") |
19 | 19 | if not ("yes" in gcc_plugin): |
20 | | - raise RuntimeError("Score-P uses GCC but is not build with GCC Compiler Plugin. " |
21 | | - "GCC plug-in support is:\n{}".format(gcc_plugin)) |
| 20 | + raise RuntimeError( |
| 21 | + "Score-P uses GCC but is not build with GCC Compiler Plugin. " |
| 22 | + "GCC plug-in support is:\n{}".format(gcc_plugin) |
| 23 | + ) |
22 | 24 |
|
23 | 25 |
|
24 | 26 | cmodules = [] |
25 | 27 | (include, _, _, _, _) = scorep.helper.generate_compile_deps([]) |
26 | | -src_folder = os.path.abspath('src') |
| 28 | +src_folder = os.path.abspath("src") |
27 | 29 | include += [src_folder] |
28 | | -sources = ['src/methods.cpp', 'src/scorep_bindings.cpp', 'src/scorepy/events.cpp'] |
29 | | -define_macros = [('PY_SSIZE_T_CLEAN', '1')] |
| 30 | +sources = [ |
| 31 | + "src/methods.cpp", |
| 32 | + "src/scorep_bindings.cpp", |
| 33 | + "src/scorepy/events.cpp", |
| 34 | + "src/scorepy/pathUtils.cpp", |
| 35 | +] |
| 36 | +define_macros = [("PY_SSIZE_T_CLEAN", "1")] |
30 | 37 | # We are using the UTF-8 string features from Python 3 |
31 | 38 | # The C Instrumenter functions are not available on PyPy |
32 | 39 | if has_c_instrumenter(): |
33 | | - sources.extend([ |
34 | | - 'src/classes.cpp', |
35 | | - 'src/scorepy/cInstrumenter.cpp', |
36 | | - 'src/scorepy/pythonHelpers.cpp', |
37 | | - 'src/scorepy/pathUtils.cpp', |
38 | | - ]) |
39 | | - define_macros.append(('SCOREPY_ENABLE_CINSTRUMENTER', '1')) |
| 40 | + sources.extend( |
| 41 | + [ |
| 42 | + "src/classes.cpp", |
| 43 | + "src/scorepy/cInstrumenter.cpp", |
| 44 | + "src/scorepy/pythonHelpers.cpp", |
| 45 | + ] |
| 46 | + ) |
| 47 | + define_macros.append(("SCOREPY_ENABLE_CINSTRUMENTER", "1")) |
40 | 48 | else: |
41 | | - define_macros.append(('SCOREPY_ENABLE_CINSTRUMENTER', '0')) |
| 49 | + define_macros.append(("SCOREPY_ENABLE_CINSTRUMENTER", "0")) |
42 | 50 |
|
43 | | -cmodules.append(Extension('scorep._bindings', |
44 | | - include_dirs=include, |
45 | | - define_macros=define_macros, |
46 | | - extra_compile_args=["-std=c++11"], |
47 | | - sources=sources)) |
| 51 | +cmodules.append( |
| 52 | + Extension( |
| 53 | + "scorep._bindings", |
| 54 | + include_dirs=include, |
| 55 | + define_macros=define_macros, |
| 56 | + extra_compile_args=["-std=c++11"], |
| 57 | + sources=sources, |
| 58 | + ) |
| 59 | +) |
48 | 60 |
|
49 | 61 | setup( |
50 | | - name='scorep', |
| 62 | + name="scorep", |
51 | 63 | version=scorep._version.__version__, |
52 | | - description='This is a Score-P tracing package for python', |
53 | | - author='Andreas Gocht', |
54 | | - author_email='andreas.gocht@tu-dresden.de', |
55 | | - url='https://github.com/score-p/scorep_binding_python', |
56 | | - long_description=''' |
| 64 | + description="This is a Score-P tracing package for python", |
| 65 | + author="Andreas Gocht", |
| 66 | + author_email="andreas.gocht@tu-dresden.de", |
| 67 | + url="https://github.com/score-p/scorep_binding_python", |
| 68 | + long_description=""" |
57 | 69 | This package allows tracing of python code using Score-P. |
58 | 70 | A working Score-P version is required. |
59 | 71 | To enable tracing it uses LD_PRELOAD to load the Score-P runtime libraries. |
60 | 72 | Besides this, it uses the traditional python-tracing infrastructure. |
61 | | -''', |
62 | | - packages=['scorep', 'scorep._instrumenters'], |
| 73 | +""", |
| 74 | + packages=["scorep", "scorep._instrumenters"], |
63 | 75 | ext_modules=cmodules, |
64 | 76 | classifiers=[ |
65 | | - 'Development Status :: 4 - Beta', |
66 | | - 'Environment :: Console', |
67 | | - 'Intended Audience :: Developers', |
68 | | - 'Topic :: Software Development :: Testing', |
69 | | - 'Topic :: Software Development :: Quality Assurance', |
70 | | - 'Programming Language :: Python :: 2', |
71 | | - 'Programming Language :: Python :: 2.7', |
72 | | - 'Programming Language :: Python :: 3', |
73 | | - 'Programming Language :: Python :: 3.4', |
74 | | - 'Programming Language :: Python :: 3.5', |
75 | | - 'Programming Language :: Python :: 3.6', |
76 | | - 'Programming Language :: Python :: 3.7', |
77 | | - 'Programming Language :: Python :: 3.8', |
78 | | - 'Programming Language :: Python :: 3.9', |
79 | | - 'Programming Language :: Python :: Implementation :: CPython', |
80 | | - 'Programming Language :: Python :: Implementation :: PyPy', |
81 | | - 'Operating System :: POSIX', |
82 | | - 'Operating System :: Unix', |
| 77 | + "Development Status :: 4 - Beta", |
| 78 | + "Environment :: Console", |
| 79 | + "Intended Audience :: Developers", |
| 80 | + "Topic :: Software Development :: Testing", |
| 81 | + "Topic :: Software Development :: Quality Assurance", |
| 82 | + "Programming Language :: Python :: 2", |
| 83 | + "Programming Language :: Python :: 2.7", |
| 84 | + "Programming Language :: Python :: 3", |
| 85 | + "Programming Language :: Python :: 3.4", |
| 86 | + "Programming Language :: Python :: 3.5", |
| 87 | + "Programming Language :: Python :: 3.6", |
| 88 | + "Programming Language :: Python :: 3.7", |
| 89 | + "Programming Language :: Python :: 3.8", |
| 90 | + "Programming Language :: Python :: 3.9", |
| 91 | + "Programming Language :: Python :: Implementation :: CPython", |
| 92 | + "Programming Language :: Python :: Implementation :: PyPy", |
| 93 | + "Operating System :: POSIX", |
| 94 | + "Operating System :: Unix", |
83 | 95 | ], |
84 | 96 | ) |
0 commit comments