Skip to content

Commit

Permalink
Merge pull request #9 from scarecrow1123/master
Browse files Browse the repository at this point in the history
Using setuptools to install pesq package
  • Loading branch information
ludlows authored Jun 18, 2020
2 parents e6072da + 800faa1 commit fbd48e0
Showing 1 changed file with 21 additions and 12 deletions.
33 changes: 21 additions & 12 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,34 @@
# 2019-May
# github.com/ludlows
# Python Wrapper for PESQ Score (narrow band and wide band)
import numpy

from setuptools import find_packages
from distutils.core import setup
from distutils.extension import Extension
from setuptools import setup, Extension

from Cython.Build import cythonize, build_ext

with open("README.md", "r") as fh:
long_description = fh.read()


class CyPesqExtension(Extension):
def __init__(self, *args, **kwargs):
self._include = []
super().__init__(*args, **kwargs)

@property
def include_dirs(self):
import numpy
return self._include + [numpy.get_include()]

@include_dirs.setter
def include_dirs(self, dirs):
self._include = dirs


extensions = [
Extension(
CyPesqExtension(
"cypesq",
["pesq/cypesq.pyx", "pesq/dsp.c", "pesq/pesqdsp.c","pesq/pesqmod.c"],
include_dirs=['pesq', numpy.get_include()],
include_dirs=['pesq'],
language="c")
]
setup(
Expand All @@ -29,16 +41,13 @@
url="https://github.com/ludlows/python-pesq",
packages=find_packages(),
package_data={'pesq':["*.pyx", "*.h", "dsp.c", "pesqdsp.c", "pesqmod.c"]},
# cmdclass = {'build_ext': build_ext},
ext_package='pesq',
ext_modules=cythonize(extensions),
setup_requires=['numpy', 'cython', 'pytest-runner'],
ext_modules=extensions,
setup_requires=['setuptools>=18.0', 'cython', 'numpy', 'pytest-runner'],
tests_require=['pytest'],
classifiers=[
"Programming Language :: Python",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
]
)


0 comments on commit fbd48e0

Please sign in to comment.