Skip to content

Commit 11e6d0d

Browse files
authored
Move most stuff from setup.py to pyproject.toml (#141)
1 parent 0a8ceac commit 11e6d0d

File tree

10 files changed

+1533
-78
lines changed

10 files changed

+1533
-78
lines changed

.github/workflows/test.yml

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Run Tests
22
on: [push, pull_request]
33
env:
4+
UV_PYTHON_DOWNLOADS: never
45
PYTEST_ADDOPTS: "--color=yes"
56
jobs:
67
tests:
@@ -12,7 +13,7 @@ jobs:
1213
- os: ubuntu-latest
1314
jack: jackd1
1415
# x86_64:
15-
- os: macos-13
16+
- os: macos-15-intel
1617
# arm64:
1718
- os: macos-latest
1819
- os: windows-latest
@@ -41,40 +42,30 @@ jobs:
4142
shell: bash
4243
run: |
4344
jackd --no-realtime -d dummy &
44-
- name: Set up Python
45-
uses: actions/setup-python@v6
46-
with:
47-
python-version: "3"
48-
- name: Double-check Python version
49-
run: |
50-
python --version
5145
- uses: actions/checkout@v5
46+
- name: Install uv
47+
uses: astral-sh/setup-uv@v6
5248
- name: Install Python package
5349
run: |
54-
python -m pip install .
55-
- name: Install pytest
56-
run: |
57-
python -m pip install pytest
50+
uv sync --locked
51+
uv run jack_build.py
5852
- name: Run tests
5953
run: |
60-
python -m pytest
54+
uv run pytest
6155
6256
docs:
6357
runs-on: ubuntu-latest
6458
steps:
65-
- name: Set up Python
66-
uses: actions/setup-python@v6
59+
- uses: actions/checkout@v5
6760
with:
68-
python-version: "3"
61+
fetch-depth: 0
6962
- name: Double-check Python version
7063
run: |
7164
python --version
72-
- uses: actions/checkout@v5
73-
with:
74-
fetch-depth: 0
7565
- name: Install doc dependencies
7666
run: |
77-
python -m pip install -r doc/requirements.txt
67+
python -m pip install --upgrade pip
68+
python -m pip install --group doc
7869
- name: Create HTML docs
7970
run: |
8071
python -m sphinx -W --keep-going --color -d _build/doctrees doc _build/html -b html

.readthedocs.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
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+
install:
10+
- pip install --upgrade pip
11+
- pip install --group doc .
912
sphinx:
1013
configuration: doc/conf.py
11-
python:
12-
install:
13-
- requirements: doc/requirements.txt

CONTRIBUTING.rst

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ newest development version from Github_::
1111

1212
git clone https://github.com/spatialaudio/jackclient-python.git
1313
cd jackclient-python
14-
python3 -m pip install -e .
14+
python -m pip install -e .
15+
python jack_build.py
1516

1617
... where ``-e`` stands for ``--editable``.
1718
This way, your installation always stays up-to-date, even if you pull new
@@ -29,24 +30,24 @@ If you make changes to the documentation, you can locally re-create the HTML
2930
pages using Sphinx_.
3031
You can install it and a few other necessary packages with::
3132

32-
python3 -m pip install -r doc/requirements.txt
33+
python -m pip install -r doc/requirements.txt
3334

3435
To create the HTML pages, use::
3536

36-
python3 setup.py build_sphinx
37+
python -m sphinx doc _build
3738

38-
The generated files will be available in the directory ``build/sphinx/html/``.
39+
The generated files will be available in the directory ``_build/``.
3940

4041
.. _Sphinx: https://www.sphinx-doc.org/
4142

4243
There are no proper tests (yet?), but the code examples from the README file
4344
can be verified with pytest_.
4445
If you haven't installed it already, you can install it with::
4546

46-
python3 -m pip install pytest
47+
python -m pip install pytest
4748

4849
As soon as pytest_ is installed, you can run the (rudimentary) tests with::
4950

50-
python3 -m pytest
51+
python -m pytest
5152

5253
.. _pytest: https://pytest.org/

MANIFEST.in

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

doc/installation.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ Installation
66

77
You can use ``pip`` to install the ``jack`` module::
88

9-
python3 -m pip install JACK-Client
9+
python -m pip install JACK-Client
1010

1111
Depending on your Python installation (see `Requirements`_ below),
12-
you may have to use ``python`` instead of ``python3``.
12+
you may have to use ``python3`` instead of ``python``.
1313
If you have installed the module already, you can use the ``--upgrade`` flag to
1414
get the newest release.
1515

1616
To un-install, use::
1717

18-
python3 -m pip uninstall JACK-Client
18+
python -m pip uninstall JACK-Client
1919

2020
Requirements
2121
------------
@@ -38,7 +38,7 @@ pip/setuptools:
3838
page.
3939
If you happen to have ``pip`` but not ``setuptools``, use this command::
4040

41-
python3 -m pip install setuptools
41+
python -m pip install setuptools
4242

4343
To upgrade to a newer version of an already installed package (including
4444
``pip`` itself), use the ``--upgrade`` flag.
@@ -71,7 +71,7 @@ NumPy (optional):
7171
You can also install NumPy with ``pip``, but depending on your platform, this
7272
might require a compiler and several additional libraries::
7373

74-
python3 -m pip install NumPy
74+
python -m pip install NumPy
7575

7676
.. _JACK: https://jackaudio.org/
7777
.. _NumPy: https://numpy.org/

doc/requirements.txt

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

jack_build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,4 +318,4 @@
318318
""", packed=True)
319319

320320
if __name__ == '__main__':
321-
ffibuilder.compile(verbose=True)
321+
ffibuilder.compile(tmpdir='src', verbose=True)

pyproject.toml

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,42 @@
11
[build-system]
2-
requires = ["setuptools >= 61.0"]
2+
requires = ["setuptools", "setuptools-scm", "cffi"]
33
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "JACK-Client"
7+
license = "MIT"
8+
dynamic = ["version"]
9+
description = "JACK Audio Connection Kit (JACK) Client for Python"
10+
readme = "README.rst"
11+
keywords = ["JACK", "audio", "low-latency", "multi-channel"]
12+
authors = [{ name = "Matthias Geier", email = "[email protected]" }]
13+
classifiers = [
14+
"Operating System :: OS Independent",
15+
"Programming Language :: Python",
16+
"Programming Language :: Python :: 3",
17+
"Topic :: Multimedia :: Sound/Audio",
18+
]
19+
requires-python = ">=3.7"
20+
dependencies = ["cffi"]
21+
22+
[project.urls]
23+
Documentation = "http://jackclient-python.readthedocs.io/"
24+
Repository = "https://github.com/spatialaudio/jackclient-python/"
25+
Issues = "https://github.com/spatialaudio/jackclient-python/issues"
26+
27+
[dependency-groups]
28+
dev = [{ include-group = "test" }, { include-group = "doc" }]
29+
test = ["pytest"]
30+
doc = [
31+
"insipid-sphinx-theme",
32+
"sphinx-last-updated-by-git",
33+
]
34+
35+
[tool.setuptools]
36+
py-modules = ["jack", "_jack"]
37+
38+
[tool.setuptools.packages.find]
39+
where = ["src"]
40+
41+
[tool.setuptools.dynamic]
42+
version = { attr = "jack.__version__" }

setup.py

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,5 @@
11
from setuptools import setup
22

3-
__version__ = 'unknown'
4-
5-
# "import" __version__
6-
for line in open('src/jack.py'):
7-
if line.startswith('__version__'):
8-
exec(line)
9-
break
10-
113
setup(
12-
name='JACK-Client',
13-
version=__version__,
14-
package_dir={'': 'src'},
15-
py_modules=['jack'],
16-
setup_requires=['CFFI>=1.0'],
17-
install_requires=['CFFI>=1.0'],
18-
python_requires='>=3.7',
19-
extras_require={'NumPy': ['NumPy']},
204
cffi_modules=['jack_build.py:ffibuilder'],
21-
author='Matthias Geier',
22-
author_email='[email protected]',
23-
description='JACK Audio Connection Kit (JACK) Client for Python',
24-
long_description=open('README.rst').read(),
25-
license='MIT',
26-
keywords='JACK audio low-latency multi-channel'.split(),
27-
url='http://jackclient-python.readthedocs.io/',
28-
platforms='any',
29-
classifiers=[
30-
'License :: OSI Approved :: MIT License',
31-
'Operating System :: OS Independent',
32-
'Programming Language :: Python',
33-
'Programming Language :: Python :: 3',
34-
'Programming Language :: Python :: 3 :: Only',
35-
'Topic :: Multimedia :: Sound/Audio',
36-
],
37-
zip_safe=True,
385
)

0 commit comments

Comments
 (0)