Skip to content

Commit

Permalink
Restructure build to use pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
ideoforms committed Aug 3, 2024
1 parent 0752014 commit da7bcf2
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 42 deletions.
File renamed without changes.
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["setuptools", "wheel", "setuptools_scm", "cmake", "scikit-build"]
build-backend = "setuptools.build_meta"
52 changes: 48 additions & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,49 @@
[aliases]
test=pytest
[metadata]
name = signalflow
version = 0.4.9
author = Daniel Jones
author_email = [email protected]
description = SignalFlow is a sound synthesis library designed to make it quick and intuitive to explore complex sonic ideas
long_description = file: README.md
long_description_content_type = text/markdown
keywords = audio, sound, synthesis, dsp, sound-synthesis
classifiers =
Topic :: Multimedia :: Sound/Audio
Topic :: Multimedia :: Sound/Audio :: Sound Synthesis
Topic :: Artistic Software
Development Status :: 4 - Beta
Intended Audience :: Developers

[tool:pytest]
addopts = --verbose
[options]
python_requires = >=3.8
setup_requires =
pytest-runner
pybind11-stubgen
install_requires =
numpy
tests_require =
pytest
numpy
scipy
package_dir =
= auxiliary/libs
packages =
signalflow_stubs
signalflow_midi
signalflow_cli
signalflow_examples
signalflow_visualisation
signalflow_analysis
include_package_data = true

[options.packages.find]
exclude =
tests

[options.entry_points]
console_scripts =
signalflow = signalflow_cli:main

[options.package_data]
signalflow_stubs = *.pyi
signalflow = *.pyd
45 changes: 7 additions & 38 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class CMakeExtension(Extension):
def __init__(self, name, sourcedir=''):
Extension.__init__(self, name, sources=[])
super().__init__(name, sources=[])
self.sourcedir = os.path.abspath(sourcedir)


Expand All @@ -20,17 +20,18 @@ def run(self):

def build_extension(self, ext):
extdir = os.path.abspath(self.build_lib)

cfg = 'Debug' if self.debug else 'Release'
cpu_count = os.cpu_count()
build_args = ['--config', cfg, '-j', str(cpu_count)]

print("Building signalflow version " + self.distribution.get_version())
print("Detected %d CPUs" % os.cpu_count())
cmake_args = ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=' + extdir,
'-DCMAKE_BUILD_PYTHON=1',
'-DCMAKE_BUILD_TYPE=' + cfg,
'-DSIGNALFLOW_VERSION=' + self.distribution.get_version()]
cmake_args = [
'-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=' + extdir,
'-DCMAKE_BUILD_PYTHON=1',
'-DCMAKE_BUILD_TYPE=' + cfg,
'-DSIGNALFLOW_VERSION=' + self.distribution.get_version()
]
if 'CMAKE_OSX_ARCHITECTURES' in os.environ:
cmake_args += ['-DCMAKE_OSX_ARCHITECTURES=%s' % os.environ['CMAKE_OSX_ARCHITECTURES']]

Expand Down Expand Up @@ -68,38 +69,6 @@ def build_extension(self, ext):
signalflow_package_data = ['*.pyd']

setup(
name='signalflow',
version='0.4.7',
author='Daniel Jones',
author_email='[email protected]',
description='SignalFlow is a sound synthesis library designed to make it quick and intuitive to explore complex sonic ideas',
keywords=['audio', 'sound', 'synthesis', 'dsp', 'sound-synthesis'],
classifiers=[
'Topic :: Multimedia :: Sound/Audio',
'Topic :: Multimedia :: Sound/Audio :: Sound Synthesis',
'Topic :: Artistic Software',
'Development Status :: 4 - Beta',
'Intended Audience :: Developers'
],
long_description=open("README.md", "r").read(),
long_description_content_type="text/markdown",
ext_modules=[CMakeExtension('signalflow')],
cmdclass=dict(build_ext=CMakeBuild),
python_requires=">=3.8",
setup_requires=['pytest-runner', 'pybind11-stubgen'],
install_requires=['numpy'],
tests_require=['pytest', 'numpy', 'scipy'],
package_dir={'': 'auxiliary/libs'},
packages=signalflow_packages,
include_package_data=True,
# signalflow-stubs contains type hint data in a .pyi file, per PEP 561
package_data={
"signalflow-stubs": ["*.pyi"],
"signalflow": signalflow_package_data
},
entry_points = {
'console_scripts': [
'signalflow = signalflow_cli:main',
],
}
)

0 comments on commit da7bcf2

Please sign in to comment.