-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathsetup.py
96 lines (91 loc) · 3.39 KB
/
setup.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
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
# -*- coding: utf-8 -*-
"""setup.py: setuptools control."""
import os
from setuptools import setup, find_packages, Extension
import versioneer
with open('README.md', 'rb') as f:
long_descr = f.read().decode('utf-8').replace(
'(stockwell.png)',
'(https://cdn.jsdelivr.net/gh/claudiodsf/stockwell/stockwell.png)'
).replace(
'(inv_stockwell.png)',
'(https://cdn.jsdelivr.net/gh/claudiodsf/stockwell/inv_stockwell.png)'
)
project_urls = {
'Homepage': 'https://github.com/claudiodsf/stockwell',
'Source': 'https://github.com/claudiodsf/stockwell',
}
include_dirs_st = []
library_dirs_st = []
# First search for fftw3 in the "external" directory
# (i.e., installed using the script "get_fftw3.sh")
fftw3_dir = os.path.join('external', 'fftw3')
if os.path.exists(fftw3_dir):
include_dirs_st.append(os.path.join(fftw3_dir, 'include'))
library_dirs_st.append(os.path.join(fftw3_dir, 'lib'))
else:
# Search Homebrew fftw3 on macOS
if 'HOMEBREW_PREFIX' in os.environ:
include_dirs_st.append(
os.path.join(os.environ['HOMEBREW_PREFIX'], 'include'))
library_dirs_st.append(
os.path.join(os.environ['HOMEBREW_PREFIX'], 'lib'))
# Search for a version of fftw3 provided by Conda
if 'CONDA_PREFIX' in os.environ:
include_dirs_st.append(
os.path.join(os.environ['CONDA_PREFIX'], 'Library', 'include'))
library_dirs_st.append(
os.path.join(os.environ['CONDA_PREFIX'], 'Library', 'lib'))
# This is needed for Miniconda on GitHub-hosted Windows runner
if 'CONDA' in os.environ:
include_dirs_st.append(
os.path.join(os.environ['CONDA'], 'Library', 'include'))
library_dirs_st.append(
os.path.join(os.environ['CONDA'], 'Library', 'lib'))
ext_modules = [
Extension(
'st',
sources=['stockwell/c_libs/st.c'],
include_dirs=include_dirs_st,
library_dirs=library_dirs_st,
libraries=['fftw3'],
),
Extension(
'sine',
sources=['stockwell/c_libs/sine.c'],
)
]
setup(
name='stockwell',
packages=find_packages(),
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
ext_package='stockwell.lib',
ext_modules=ext_modules,
description='Time-frequency analysis through Stockwell transform',
long_description=long_descr,
long_description_content_type='text/markdown',
author='Claudio Satriano',
url=project_urls['Homepage'],
project_urls=project_urls,
license='GNU General Public License v3 or later (GPLv3+)',
platforms='OS Independent',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: '
'GNU General Public License v3 or later (GPLv3+)',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
'Topic :: Scientific/Engineering',
'Topic :: Scientific/Engineering :: Physics'],
install_requires=['numpy>=1.18']
)