2023-01-12 16:03:40 +00:00
|
|
|
import glob, os
|
2022-10-10 17:17:38 +00:00
|
|
|
import platform
|
|
|
|
from setuptools import setup
|
|
|
|
|
2023-04-19 19:36:32 +00:00
|
|
|
pf = platform.platform()
|
|
|
|
|
|
|
|
if 'Linux' in pf:
|
2023-01-12 16:03:40 +00:00
|
|
|
ext_name_glob = 'lasp_cpp.cpython*'
|
2023-04-19 19:36:32 +00:00
|
|
|
# Split of path from file.
|
2023-01-12 16:03:40 +00:00
|
|
|
extensions = list(glob.glob('src/lasp/' + ext_name_glob))
|
2023-04-19 19:36:32 +00:00
|
|
|
elif 'Windows' in pf:
|
2023-06-11 12:33:16 +00:00
|
|
|
ext_name_glob = 'lasp_cpp*.cp*.pyd'
|
2023-01-12 18:49:32 +00:00
|
|
|
# Split of path from file.
|
2023-04-19 19:36:32 +00:00
|
|
|
extensions = list(glob.glob('src\\lasp/' + ext_name_glob))
|
|
|
|
else:
|
|
|
|
raise RuntimeError('Not yet Windows-proof')
|
2023-01-12 16:03:40 +00:00
|
|
|
|
2022-10-10 17:17:38 +00:00
|
|
|
|
|
|
|
|
2023-04-19 19:36:32 +00:00
|
|
|
print(extensions)
|
|
|
|
ext_names = [os.path.split(a)[1] for a in extensions]
|
|
|
|
|
|
|
|
if len(extensions) == 0:
|
|
|
|
raise RuntimeError('Please first run CMake to build extension')
|
|
|
|
elif len(extensions) > 1:
|
|
|
|
raise RuntimeError('Too many extension files found')
|
2022-10-10 17:17:38 +00:00
|
|
|
|
2023-04-19 19:36:32 +00:00
|
|
|
pkgdata = ext_names
|
2022-10-10 17:17:38 +00:00
|
|
|
classifiers = [
|
|
|
|
"Topic :: Scientific/Engineering",
|
|
|
|
"Programming Language :: Python :: 3.8",
|
|
|
|
"Operating System :: POSIX :: Linux",
|
|
|
|
"Operating System :: Microsoft :: Windows",
|
|
|
|
]
|
|
|
|
|
|
|
|
keywords = ["DSP", "DAQ", "Signal processing"]
|
|
|
|
|
2018-01-29 15:14:50 +00:00
|
|
|
|
|
|
|
setup(
|
2022-07-20 12:58:48 +00:00
|
|
|
name="lasp",
|
|
|
|
version="1.0",
|
2022-10-10 17:17:38 +00:00
|
|
|
description="LASP: Library for Acoustic Signal Processing",
|
|
|
|
|
2022-07-20 12:58:48 +00:00
|
|
|
author='J.A. de Jong (ASCEE / Redu-Sone)',
|
|
|
|
author_email='info@ascee.nl',
|
2022-10-10 17:17:38 +00:00
|
|
|
|
|
|
|
url='https://www.ascee.nl/lasp',
|
|
|
|
classifiers=classifiers,
|
|
|
|
keywords=keywords,
|
2022-07-20 12:58:48 +00:00
|
|
|
license="MIT",
|
2022-10-10 17:17:38 +00:00
|
|
|
dependencies=["numpy", "scipy", "appdirs", "h5py", "appdirs",
|
2023-01-12 16:03:40 +00:00
|
|
|
"dataclasses_json"],
|
|
|
|
package_dir={"": "src"},
|
2022-10-10 17:17:38 +00:00
|
|
|
packages=['lasp', 'lasp.filter', 'lasp.tools'],
|
|
|
|
include_package_data=True,
|
2023-01-12 16:03:40 +00:00
|
|
|
package_data={'lasp': pkgdata},
|
2022-07-20 12:58:48 +00:00
|
|
|
python_requires='>=3.8',
|
2018-01-29 15:14:50 +00:00
|
|
|
)
|