Skip to content

Commit 343e6eb

Browse files
authored
ENH: support Numpy2 and legacy Numpy (#98)
* ENH: support Numpy2 and legacy Numpy * BLD: Fix build scripts
1 parent fa84b8b commit 343e6eb

File tree

4 files changed

+51
-59
lines changed

4 files changed

+51
-59
lines changed

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ test_script:
8989
Set-Location "$env:APPVEYOR_BUILD_FOLDER"
9090
9191
after_test:
92-
- python setup.py bdist_wheel
92+
- pip wheel --wheel-dir=.\dist --no-deps .
9393

9494
artifacts:
9595
- path: dist\*

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
[build-system]
22
requires = [
3-
"wheel",
43
"setuptools",
5-
"numpy",
4+
"numpy>=2; python_version>='3.9'",
5+
"oldest-supported-numpy; python_version<'3.9'",
66
"cython",
77
]
8+
build-backend = "setuptools.build_meta"

requirements.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
numpy
22
matplotlib
3-
argparse
4-
cython
5-
pysoundfile
3+
argparse; python_version<"3.5"
4+
soundfile

setup.py

Lines changed: 45 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,45 @@
1-
from __future__ import with_statement, print_function, absolute_import
2-
3-
from setuptools import setup, find_packages, Extension
4-
from distutils.version import LooseVersion
5-
6-
import sys
7-
from glob import glob
8-
from os.path import join
9-
import numpy
10-
11-
from setuptools.command.build_ext import build_ext
12-
13-
14-
_VERSION = '0.3.4'
15-
16-
17-
world_src_top = join("lib", "World", "src")
18-
world_sources = glob(join(world_src_top, "*.cpp"))
19-
20-
ext_modules = [
21-
Extension(
22-
name="pyworld.pyworld",
23-
include_dirs=[world_src_top, numpy.get_include()],
24-
sources=[join("pyworld", "pyworld.pyx")] + world_sources,
25-
language="c++")]
26-
27-
kwargs = {"encoding": "utf-8"} if int(sys.version[0]) > 2 else {}
28-
setup(
29-
name="pyworld",
30-
description="PyWorld: a Python wrapper for WORLD vocoder",
31-
long_description=open("README.md", "r", **kwargs).read(),
32-
long_description_content_type="text/markdown",
33-
ext_modules=ext_modules,
34-
cmdclass={'build_ext': build_ext},
35-
version=_VERSION,
36-
packages=find_packages(),
37-
setup_requires=[
38-
'numpy',
39-
],
40-
install_requires=[
41-
'numpy',
42-
'cython>=0.24',
43-
],
44-
extras_require={
45-
'test': ['nose'],
46-
'sdist': ['numpy', 'cython>=0.24'],
47-
},
48-
author="Pyworld Contributors",
49-
author_email="[email protected]",
50-
url="https://github.com/JeremyCCHsu/Python-Wrapper-for-World-Vocoder",
51-
keywords=['vocoder'],
52-
classifiers=[],
53-
)
1+
from __future__ import absolute_import, print_function, with_statement
2+
3+
import sys
4+
from glob import glob
5+
from os.path import join
6+
7+
import numpy
8+
from setuptools import Extension, find_packages, setup
9+
from setuptools.command.build_ext import build_ext
10+
11+
12+
_VERSION = '0.3.4'
13+
14+
15+
world_src_top = join("lib", "World", "src")
16+
world_sources = glob(join(world_src_top, "*.cpp"))
17+
18+
ext_modules = [
19+
Extension(
20+
name="pyworld.pyworld",
21+
include_dirs=[world_src_top, numpy.get_include()],
22+
sources=[join("pyworld", "pyworld.pyx")] + world_sources,
23+
language="c++")]
24+
25+
kwargs = {"encoding": "utf-8"} if int(sys.version[0]) > 2 else {}
26+
setup(
27+
name="pyworld",
28+
description="PyWorld: a Python wrapper for WORLD vocoder",
29+
long_description=open("README.md", "r", **kwargs).read(),
30+
long_description_content_type="text/markdown",
31+
ext_modules=ext_modules,
32+
cmdclass={'build_ext': build_ext},
33+
version=_VERSION,
34+
packages=find_packages(),
35+
install_requires=['numpy'],
36+
extras_require={
37+
'test': ['nose'],
38+
'sdist': ['numpy', 'cython>=0.24'],
39+
},
40+
author="Pyworld Contributors",
41+
author_email="[email protected]",
42+
url="https://github.com/JeremyCCHsu/Python-Wrapper-for-World-Vocoder",
43+
keywords=['vocoder'],
44+
classifiers=[],
45+
)

0 commit comments

Comments
 (0)