Skip to content

Commit 009e5a3

Browse files
authored
Move parts of setup.py to pyproject.toml (#596)
* Move parts of setup.py to pyproject.toml, switch to src/ layout * add uv.lock * DOC: update instructions for development build * Update CI setup * Update Sphinx config for src/ layout
1 parent ce94736 commit 009e5a3

File tree

19 files changed

+1633
-73
lines changed

19 files changed

+1633
-73
lines changed

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
fetch-depth: 0
2121
- name: Install dependencies
2222
run: |
23-
python -m pip install -r doc/requirements.txt
23+
python -m pip install --group doc
2424
- name: Build HTML
2525
run: |
2626
python -m sphinx -W --keep-going --color -d _build/doctrees/ doc/ _build/html/ -b html

.github/workflows/publish.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
name: Build and publish to PyPI
22
on: [push, pull_request]
3+
env:
4+
UV_PYTHON_DOWNLOADS: never
35
jobs:
46
build:
57
name: Build distribution
@@ -8,15 +10,11 @@ jobs:
810
- uses: actions/checkout@v5
911
with:
1012
submodules: true
11-
- name: Set up Python
12-
uses: actions/setup-python@v6
13-
with:
14-
python-version: "3"
15-
- name: Install "build"
16-
run: |
17-
python -m pip install build
13+
- name: Install uv
14+
uses: astral-sh/setup-uv@v6
1815
- name: Build binary wheels and a source tarball
19-
run: ./make_dist.sh
16+
run: |
17+
./make_dist.sh
2018
- name: Store the distribution packages
2119
uses: actions/upload-artifact@v5
2220
with:

.github/workflows/python-versions.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ jobs:
55
strategy:
66
matrix:
77
python-version:
8-
- "3.7"
8+
- "3.9"
99
- "3.13"
10-
- "pypy-3.7"
10+
- "pypy-3.9"
1111
- "pypy-3.11"
1212
runs-on: ubuntu-22.04
1313
steps:
@@ -28,7 +28,7 @@ jobs:
2828
- name: Install Python package
2929
working-directory: git-repo
3030
run: |
31-
python -m pip install .
31+
python -m pip install --group test .
3232
- name: Run tests
3333
run: |
3434
python -m sounddevice

.gitignore

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
_sounddevice.py
21
*.pyc
32
__pycache__/
4-
build/
5-
dist/
6-
.eggs/
7-
sounddevice.egg-info/
3+
/build/
4+
/_build/
5+
/dist/
6+
/src/_sounddevice.py
7+
/src/sounddevice.egg-info/

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[submodule "portaudio-binaries"]
2-
path = _sounddevice_data/portaudio-binaries
2+
path = src/_sounddevice_data/portaudio-binaries
33
url = https://github.com/spatialaudio/portaudio-binaries.git

.readthedocs.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
version: 2
22
build:
3-
os: ubuntu-22.04
3+
os: "ubuntu-24.04"
44
tools:
55
python: "3"
66
jobs:
77
post_checkout:
88
- git fetch --unshallow || true
9-
python:
10-
install:
11-
- method: pip
12-
path: .
13-
- requirements: doc/requirements.txt
9+
install:
10+
- pip install --upgrade pip
11+
- pip install --group doc .
1412
sphinx:
1513
configuration: doc/conf.py
1614
formats: all

CONTRIBUTING.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ newest development version (a.k.a. "master") from Github_::
9393
git clone --recursive https://github.com/spatialaudio/python-sounddevice.git
9494
cd python-sounddevice
9595
python -m pip install -e .
96+
python sounddevice_build.py
9697

9798
.. _PyPI: https://pypi.org/project/sounddevice/
9899
.. _Github: https://github.com/spatialaudio/python-sounddevice/
@@ -118,7 +119,7 @@ If you make changes to the documentation, you can locally re-create the HTML
118119
pages using Sphinx_.
119120
You can install it and a few other necessary packages with::
120121

121-
python -m pip install -r doc/requirements.txt
122+
python -m pip install -e . --group doc
122123

123124
To (re-)build the HTML files, use::
124125

MANIFEST.in

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
include LICENSE
2-
include *.rst
3-
include doc/requirements.txt
4-
include sounddevice_build.py
5-
recursive-include doc *.rst *.py
6-
recursive-include examples *.py
1+
prune .github
2+
exclude .git*
3+
exclude .readthedocs.yml
4+
exclude src/_sounddevice_data/README

doc/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import os
44
from subprocess import check_output
55

6-
sys.path.insert(0, os.path.abspath('..'))
6+
sys.path.insert(0, os.path.abspath('../src'))
77
sys.path.insert(0, os.path.abspath('.'))
88

99
# Fake import to avoid actually loading CFFI and the PortAudio library

doc/requirements.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)