Skip to content

Commit 3ffefb0

Browse files
committed
Modernize package setup
1 parent 577f8e2 commit 3ffefb0

File tree

7 files changed

+466
-59
lines changed

7 files changed

+466
-59
lines changed

.github/workflows/main.yml

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,27 @@ name: Python Tests
22

33
on: [push]
44

5-
jobs:
6-
build:
75

6+
jobs:
7+
test:
8+
name: Run tests
89
runs-on: ubuntu-latest
910
strategy:
1011
matrix:
11-
python: ["3.8", "3.9", "3.10", "3.11"]
12-
12+
python: ["3.9", "3.10", "3.11"]
1313
steps:
14-
- uses: actions/checkout@v2
15-
- name: Setup Python
16-
uses: actions/setup-python@v2
14+
- uses: actions/checkout@v4
15+
- name: Install Python tools
16+
uses: BrandonLWhite/[email protected]
17+
- name: Setup Python with poetry caching
18+
# poetry cache requires poetry to already be installed, weirdly
19+
uses: actions/setup-python@v5
1720
with:
18-
python-version: ${{ matrix.python }}
21+
python-version: ${{ matrix.python-version }}
22+
cache: poetry
1923
- name: Install ffmpeg
2024
run: sudo apt install -y --no-install-recommends ffmpeg
21-
- name: Install tox and any other packages
22-
run: pip install tox
23-
- name: Run tox
24-
# Run tox using the version of Python in `PATH`
25-
run: tox -e py
25+
- name: Test
26+
run: |-
27+
poetry install --extras=test
28+
poe test

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ A second optional parameter to ``audio_open`` specifies which backends to try
5555
``available_backends`` function to get a list backends that are usable on the
5656
current system.
5757

58-
Audioread supports Python 3 (3.8+).
58+
Audioread supports Python 3 (3.9+).
5959

6060
Example
6161
-------

audioread/version.py

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

poetry.lock

Lines changed: 379 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 52 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,61 @@
1-
[build-system]
2-
requires = ["flit_core >=3.2,<4"]
3-
build-backend = "flit_core.buildapi"
4-
51
[project]
62
name = "audioread"
3+
version = "3.1.0a0"
4+
description = "Multi-library, cross-platform audio decoding."
75
authors = [
8-
{name = "Adrian Sampson", email = "[email protected]"}
6+
{ name = "Adrian Sampson", email = "[email protected]" },
97
]
108
readme = "README.rst"
11-
requires-python = ">=3.6"
12-
dynamic = ["version", "description"]
13-
urls.Home = "https://github.com/beetbox/audioread"
9+
license = "MIT"
10+
requires-python = ">=3.9"
1411
classifiers = [
15-
'Topic :: Multimedia :: Sound/Audio :: Conversion',
16-
'Intended Audience :: Developers',
17-
'Programming Language :: Python :: 3',
18-
'Programming Language :: Python :: 3.8',
19-
'Programming Language :: Python :: 3.9',
20-
'Programming Language :: Python :: 3.10',
21-
'Programming Language :: Python :: 3.11',
22-
'License :: OSI Approved :: MIT License',
12+
"Topic :: Multimedia :: Sound/Audio :: Conversion",
13+
"Intended Audience :: Developers",
14+
"Programming Language :: Python :: 3",
15+
"Programming Language :: Python :: 3.9",
16+
"Programming Language :: Python :: 3.10",
17+
"Programming Language :: Python :: 3.11",
18+
"License :: OSI Approved :: MIT License",
2319
]
24-
license = {file = "LICENSE"}
20+
21+
[project.urls]
22+
Homepage = "https://github.com/beetbox/audioread"
23+
Repository = "https://github.com/beetbox/audioread"
24+
"Bug Tracker" = "https://github.com/beetbox/audioread/issues"
2525

2626
[project.optional-dependencies]
27-
test = [
28-
"tox"
29-
]
27+
test = ["pytest >= 8.4.2", "pytest-cov >= 7.0.0"]
28+
mad = ["pymad[mad] (>=0.11.3,<0.12.0)"]
29+
gi = ["pygobject (>=3.54.2,<4.0.0)"]
30+
31+
[build-system]
32+
requires = ["poetry-core"]
33+
build-backend = "poetry.core.masonry.api"
34+
35+
[tool.pipx-install]
36+
poethepoet = ">=0.26"
37+
poetry = ">=2.1"
38+
39+
[tool.poetry.requires-plugins]
40+
poethepoet = ">=0.32"
41+
42+
[tool.poe.tasks.test]
43+
help = "Run tests with pytest"
44+
cmd = "pytest $OPTS"
45+
env.OPTS.default = "-p no:cov"
46+
47+
[tool.poe.tasks.test-with-coverage]
48+
help = "Run tests and record coverage"
49+
ref = "test"
50+
# record coverage in audioread package
51+
# save xml for coverage upload to coveralls
52+
# save html report for local dev use
53+
# measure coverage across logical branches
54+
# show which tests cover specific lines in the code (see the HTML report)
55+
env.OPTS = """
56+
--cov=audioread
57+
--cov-report=xml:.reports/coverage.xml
58+
--cov-report=html:.reports/html
59+
--cov-branch
60+
--cov-context=test
61+
"""

setup.cfg

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[coverage:run]
2+
data_file = .reports/coverage/data
3+
branch = true
4+
relative_files = true
5+
6+
[coverage:report]
7+
precision = 2
8+
skip_empty = true
9+
show_missing = true
10+
exclude_also =
11+
@atexit.register
12+
if TYPE_CHECKING
13+
if typing.TYPE_CHECKING
14+
raise AssertionError
15+
raise NotImplementedError
16+
17+
[coverage:html]
18+
show_contexts = true

tox.ini

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

0 commit comments

Comments
 (0)