diff --git a/.github/workflows/python-versions.yml b/.github/workflows/python-versions.yml index e179bd2..00ed288 100644 --- a/.github/workflows/python-versions.yml +++ b/.github/workflows/python-versions.yml @@ -5,9 +5,9 @@ jobs: strategy: matrix: python-version: - - "3.7" + - "3.9" - "3.13" - - "pypy-3.7" + - "pypy-3.9" - "pypy-3.11" runs-on: ubuntu-22.04 steps: @@ -28,7 +28,7 @@ jobs: - name: Install Python package working-directory: git-repo run: | - python -m pip install . + python -m pip install --group test . - name: Run tests run: | python -m sounddevice diff --git a/.readthedocs.yml b/.readthedocs.yml index f862743..0ad400a 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -6,11 +6,9 @@ build: jobs: post_checkout: - git fetch --unshallow || true -python: - install: - - method: pip - path: . - - requirements: doc/requirements.txt + install: + - pip install --upgrade pip + - pip install --group doc . sphinx: configuration: doc/conf.py formats: all diff --git a/make_dist.sh b/make_dist.sh index 4c4fe6e..fc8d520 100755 --- a/make_dist.sh +++ b/make_dist.sh @@ -8,6 +8,9 @@ PYTHON=python3 make_wheel() { + # This makes sure that only the appropriate libraries are copied: + rm -rf sounddevice.egg-info/ + PYTHON_SOUNDDEVICE_PLATFORM=$1 PYTHON_SOUNDDEVICE_ARCHITECTURE=${2:-} \ $PYTHON -m build } @@ -19,8 +22,5 @@ make_wheel Windows 32bit make_wheel Windows 64bit -# This makes sure that the libraries are not copied to the final sdist: -rm -rf sounddevice.egg-info/ - # This creates a "pure" wheel: make_wheel Linux diff --git a/pyproject.toml b/pyproject.toml index 68847bb..650886d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,39 @@ [build-system] -requires = ["setuptools >= 61.0"] +requires = ["setuptools", "cffi"] build-backend = "setuptools.build_meta" + +[project] +name = "sounddevice" +license = "MIT" +dynamic = ["version"] +description = "Play and Record Sound with Python" +readme = "README.rst" +keywords = ["sound", "audio", "PortAudio", "play", "record", "playrec"] +authors = [{ name = "Matthias Geier", email = "Matthias.Geier@gmail.com" }] +classifiers = [ + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Topic :: Multimedia :: Sound/Audio", +] +requires-python = ">=3.7" +dependencies = ["cffi"] + +[project.optional-dependencies] +numpy = ["numpy"] + +[dependency-groups] +dev = [{ include-group = "test" }, { include-group = "doc" }] +test = [] +doc = [ + "insipid-sphinx-theme", + "sphinx-last-updated-by-git", +] + +[project.urls] +Documentation = "https://python-sounddevice.readthedocs.io/" +Repository = "https://github.com/spatialaudio/python-sounddevice/" +Issues = "https://github.com/spatialaudio/python-sounddevice/issues" + +[tool.setuptools.dynamic] +version = { attr = "sounddevice.__version__" } diff --git a/setup.py b/setup.py index 7f9cfb0..08c349a 100644 --- a/setup.py +++ b/setup.py @@ -2,13 +2,6 @@ import platform from setuptools import setup -# "import" __version__ -__version__ = 'unknown' -for line in open('sounddevice.py'): - if line.startswith('__version__'): - exec(line) - break - MACOSX_VERSIONS = '.'.join([ 'macosx_10_6_x86_64', # for compatibility with pip < v21 'macosx_10_6_universal2', @@ -63,34 +56,10 @@ def get_tag(self): cmdclass = {'bdist_wheel': bdist_wheel_half_pure} setup( - name='sounddevice', - version=__version__, py_modules=['sounddevice'], packages=packages, package_data=package_data, zip_safe=zip_safe, - python_requires='>=3.7', - setup_requires=['CFFI>=1.0'], - install_requires=['CFFI>=1.0'], - extras_require={'NumPy': ['NumPy']}, cffi_modules=['sounddevice_build.py:ffibuilder'], - author='Matthias Geier', - author_email='Matthias.Geier@gmail.com', - description='Play and Record Sound with Python', - long_description=open('README.rst').read(), - license='MIT', - keywords='sound audio PortAudio play record playrec'.split(), - url='http://python-sounddevice.readthedocs.io/', - project_urls={ - 'Source': 'https://github.com/spatialaudio/python-sounddevice', - }, - platforms='any', - classifiers=[ - 'License :: OSI Approved :: MIT License', - 'Operating System :: OS Independent', - 'Programming Language :: Python', - 'Programming Language :: Python :: 3', - 'Topic :: Multimedia :: Sound/Audio', - ], cmdclass=cmdclass, )