-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
99 lines (89 loc) · 3.1 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
97
98
99
#!/usr/bin/env python
# from distutils.core import setup
# from distutils.extension import Extension
# from distutils.sysconfig import get_python_lib
from setuptools import setup
from setuptools import Extension
import os
import sys
from Cython.Build import cythonize
# from Cython.Distutils import build_ext
readme_filepath = os.path.join(os.path.dirname(__file__), "README.md")
try:
import pypandoc
long_description = pypandoc.convert(readme_filepath, 'rst')
except ImportError:
long_description = open(readme_filepath).read()
# sources
ext_sources = [
'pypitch/_pypitch.pyx',
'pypitch/pitch.cpp'
]
# extension
extra_compile_args_pitch = list()
extra_link_args_pitch = list()
if sys.platform.startswith("darwin"):
# hack: with mac os version 10.13.6 (high sierra), xcode 10 requires the use of the libc++ standard library
extra_compile_args_pitch.extend(["-stdlib=libc++", "-mmacosx-version-min=10.9"])
extra_link_args_pitch.extend(["-stdlib=libc++", "-mmacosx-version-min=10.9"])
ext = Extension(
name='pypitch.pypitch',
sources=ext_sources,
language='c++',
extra_compile_args=extra_compile_args_pitch,
extra_link_args=extra_link_args_pitch,
)
# setup
setup(
name='pypitch',
version='2.0',
description='PyPitch analyses audio streams for pitch',
long_description=long_description,
long_description_content_type='text/markdown',
author='FoFiX team',
author_email='[email protected]',
license='GPLv2+',
url='https://fofix.org',
project_urls={
'Documentation': 'https://pypitch.readthedocs.io',
'Source Code': 'https://github.com/fofix/python-pypitch',
'Bug Tracker': 'https://github.com/fofix/python-pypitch/issues',
},
packages=['pypitch'],
#package_data={'pypitch': ['*.dll']},
zip_safe=False,
classifiers=[
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)',
"Programming Language :: C++",
"Programming Language :: Cython",
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Topic :: Multimedia',
'Topic :: Multimedia :: Sound/Audio',
'Topic :: Software Development :: Libraries',
],
keywords='pitch audio',
ext_modules=cythonize(ext, compiler_directives={'language_level': sys.version_info[0]}),
setup_requires=['cython'],
install_requires=[
'Cython >= 0.27',
],
extras_require={
'tests': [
"pytest<5;python_version<'3.4'",
"pytest;python_version>'3.4'",
"numpy<1.17;python_version<'3.4'",
"numpy<1.22;python_version=='3.7'",
"numpy;python_version>'3.7'"
],
'docs': ['sphinx', 'sphinx_rtd_theme'],
},
)