setup.py 2.38 KB
Newer Older
1
2
3
#!/usr/bin/env python
# -*- coding: utf-8 -*-

4
5
from setuptools import setup, find_packages, Extension
import sys
6
import os
7

8

9
with open("README.rst") as readme_file:
10
11
12
    readme = readme_file.read()


13
14
15
16
17
requirements = ["cffi", "numpy", "pandas", "matplotlib"]
setup_requirements = [
    "pytest-runner",
]
test_requirements = ["pytest"]
18
19


20
21
22
23
24
25
# NOTE: The Python C extension is currently only used to automate
# the build process of binary wheels for distribution via PyPi.
#
# If you are building darshan yourself and make libdarshan-util.so 
# discoverable in the environment by means of LD_LIBRARY_PATH or 
# pkg-config there is no need to build the extension.
26
ext_modules = []
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
if "--with-extension" in sys.argv:
    ext_modules.append(
        Extension(
            "darshan.extension",
            # optional=True,
            sources=["darshan/extension.c"],
            include_dirs=["/usr/include"],
            libraries=["darshan-util"],
        )
    )
    sys.argv.remove("--with-extension")

#
# Find backend python files in modules and copy them into lib
#
for root, dirs, files in os.walk("../../modules"):
    for f in files:
        if f.endswith("-backend.py"):
            fname = f.replace("-backend", "")
            try:
                os.symlink("../../" + os.path.join(root, f), f"darshan/backend/{fname}")
            except:
                pass
            print("Adding {0} to backends.".format(os.path.join(root, f)))
51
52


53
setup(
54
55
    author="",
    author_email="",
56
    classifiers=[
57
58
59
60
61
62
63
64
65
        "Development Status :: 4 - Beta",
        "Intended Audience :: Developers",
        "Intended Audience :: Science/Research",
        "Natural Language :: English",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.6",
        "Programming Language :: Python :: 3.7",
        "Programming Language :: Python :: 3.8",
        "Programming Language :: Python :: 3.9",
66
67
    ],
    description="Python tools to interact with darshan log records of HPC applications.",
68
    long_description=readme,
69
    ext_modules=ext_modules,
70
71
    install_requires=requirements,
    include_package_data=True,
72
73
74
    keywords="darshan",
    name="darshan",
    packages=find_packages(include=["darshan*"]),
75
    setup_requires=setup_requirements,
76
    test_suite="tests",
77
78
    tests_require=test_requirements,
    url='https://www.mcs.anl.gov/research/projects/darshan/',
Jakob Luettgau's avatar
Jakob Luettgau committed
79
    version='0.0.8.4',
80
81
    zip_safe=False,
)