Skip to content

Commit 6ee9dc8

Browse files
authored
Merge pull request #8 from mopidy/jodal/ext-template-2.2.0
2 parents 14bc85e + 253b8ec commit 6ee9dc8

File tree

16 files changed

+445
-357
lines changed

16 files changed

+445
-357
lines changed

.copier-answers.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
_commit: v2.2.0
2+
_src_path: gh:mopidy/mopidy-ext-template
3+
author_email: stein.magnus@jodal.no
4+
author_full_name: Stein Magnus Jodal
5+
dist_name: mopidy-nad
6+
ext_name: nad
7+
github_username: mopidy
8+
short_description: Mopidy extension for controlling volume on a NAD amplifier

.github/workflows/ci.yml

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,47 +5,57 @@ on:
55
push:
66
branches:
77
- main
8+
workflow_dispatch:
89

910
jobs:
11+
build:
12+
name: Build
13+
runs-on: ubuntu-24.04
14+
steps:
15+
- uses: actions/checkout@v6
16+
- uses: hynek/build-and-inspect-python-package@v2
17+
1018
main:
1119
strategy:
1220
fail-fast: false
1321
matrix:
1422
include:
15-
- name: "Test: Python 3.9"
16-
python: "3.9"
17-
tox: py39
18-
- name: "Test: Python 3.10"
19-
python: "3.10"
20-
tox: py310
21-
- name: "Test: Python 3.11"
22-
python: "3.11"
23-
tox: py311
23+
- name: "pytest (3.13)"
24+
python: "3.13"
25+
tox: "3.13"
26+
- name: "pytest (3.14)"
27+
python: "3.14"
28+
tox: "3.14"
2429
coverage: true
25-
- name: "Lint: check-manifest"
26-
python: "3.11"
27-
tox: check-manifest
28-
- name: "Lint: flake8"
29-
python: "3.11"
30-
tox: flake8
30+
- name: "pyright"
31+
python: "3.14"
32+
tox: "pyright"
33+
- name: "ruff check"
34+
python: "3.14"
35+
tox: "ruff-check"
36+
- name: "ruff format"
37+
python: "3.14"
38+
tox: "ruff-format"
3139

3240
name: ${{ matrix.name }}
33-
runs-on: ubuntu-22.04
41+
runs-on: ubuntu-24.04
3442
container: ghcr.io/mopidy/ci:latest
3543

3644
steps:
37-
- uses: actions/checkout@v3
45+
- uses: actions/checkout@v6
3846
- name: Fix home dir permissions to enable pip caching
3947
run: chown -R root /github/home
40-
- uses: actions/setup-python@v4
48+
- uses: actions/setup-python@v6
4149
with:
4250
python-version: ${{ matrix.python }}
4351
cache: pip
44-
cache-dependency-path: setup.cfg
45-
- run: python -m pip install pygobject tox
52+
allow-prereleases: true
53+
- run: python -m pip install tox
4654
- run: python -m tox -e ${{ matrix.tox }}
4755
if: ${{ ! matrix.coverage }}
4856
- run: python -m tox -e ${{ matrix.tox }} -- --cov-report=xml
4957
if: ${{ matrix.coverage }}
50-
- uses: codecov/codecov-action@v3
58+
- uses: codecov/codecov-action@v5
5159
if: ${{ matrix.coverage }}
60+
with:
61+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/release.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ on:
66

77
jobs:
88
release:
9-
runs-on: ubuntu-20.04
10-
9+
runs-on: ubuntu-24.04
10+
environment:
11+
name: pypi
12+
url: https://pypi.org/project/mopidy-nad/
13+
permissions:
14+
id-token: write
1115
steps:
12-
- uses: actions/checkout@v2
13-
- uses: actions/setup-python@v2
14-
with:
15-
python-version: '3.9'
16-
- name: "Install dependencies"
17-
run: python3 -m pip install build
18-
- name: "Build package"
19-
run: python3 -m build
20-
- uses: pypa/gh-action-pypi-publish@v1.13.0
21-
with:
22-
user: __token__
23-
password: ${{ secrets.PYPI_TOKEN }}
16+
- uses: actions/checkout@v6
17+
- uses: hynek/build-and-inspect-python-package@v2
18+
id: build
19+
- uses: actions/download-artifact@v4
20+
with:
21+
name: ${{ steps.build.outputs.artifact-name }}
22+
path: dist
23+
- uses: pypa/gh-action-pypi-publish@release/v1

.gitignore

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
*.pyc
1+
*.egg-info/
2+
/*.lock
3+
/.*_cache/
24
/.coverage
3-
/.mypy_cache/
4-
/.pytest_cache/
55
/.tox/
6-
/*.egg-info
6+
/.venv/
77
/build/
88
/dist/
9-
/MANIFEST
9+
__pycache__/

MANIFEST.in

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

README.md

Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
# mopidy-nad
2+
3+
[![Latest PyPI version](https://img.shields.io/pypi/v/mopidy-nad)](https://pypi.org/p/mopidy-nad)
4+
[![CI build status](https://img.shields.io/github/actions/workflow/status/mopidy/mopidy-nad/ci.yml)](https://github.com/mopidy/mopidy-nad/actions/workflows/ci.yml)
5+
[![Test coverage](https://img.shields.io/codecov/c/gh/mopidy/mopidy-nad)](https://codecov.io/gh/mopidy/mopidy-nad)
6+
7+
[Mopidy](https://mopidy.com) extension for controlling volume on a NAD amplifier.
8+
Developed and tested with a NAD C355BEE.
9+
10+
11+
## Maintainer wanted
12+
13+
Mopidy-NAD is currently kept on life support by the Mopidy core developers.
14+
It is in need of a more dedicated maintainer.
15+
16+
If you want to be the maintainer of Mopidy-NAD, please:
17+
18+
1. Make 2-3 good pull requests improving any part of the project.
19+
20+
2. Read and get familiar with all of the project's open issues.
21+
22+
3. Send a pull request removing this section and adding yourself as the
23+
"Current maintainer" in the "Credits" section below. In the pull request
24+
description, please refer to the previous pull requests and state that
25+
you've familiarized yourself with the open issues.
26+
27+
As a maintainer, you'll be given push access to the repo and the authority to
28+
make releases to PyPI when you see fit.
29+
30+
31+
## Installation
32+
33+
Install by running:
34+
35+
```sh
36+
python3 -m pip install mopidy-nad
37+
```
38+
39+
See https://mopidy.com/ext/nad/ for alternative installation methods.
40+
41+
42+
## Configuration
43+
44+
The Mopidy-NAD extension is enabled by default. To disable it, add the
45+
following to `mopidy.conf`:
46+
47+
```ini
48+
[nad]
49+
enabled = false
50+
```
51+
52+
The NAD amplifier must be connected to the machine running Mopidy using a
53+
serial cable.
54+
55+
To use the NAD amplifier to control volume, set the `audio/mixer` config
56+
value in `mopidy.conf` to `nad`. You probably also needs to add some
57+
properties to the `nad` config section.
58+
59+
Supported properties includes:
60+
61+
- `port`: The serial device to use, defaults to `/dev/ttyUSB0`. This must
62+
be set correctly for the mixer to work.
63+
64+
- `source`: The source that should be selected on the amplifier, like
65+
`aux`, `disc`, `tape`, `tuner`, etc. Leave unset if you don't want
66+
the mixer to change it for you.
67+
68+
- `speakers-a`: Set to `on` or `off` (or `true` or `false`) if you
69+
want the mixer to make sure that speaker set A is turned on or off. Leave
70+
unset if you don't want the mixer to change it for you.
71+
72+
- `speakers-b`: See `speakers-a`.
73+
74+
Configuration example with minimum configuration, if the amplifier is available
75+
at `/dev/ttyUSB0`::
76+
77+
```ini
78+
[audio]
79+
mixer = nad
80+
```
81+
82+
Configuration example with minimum configuration, if the amplifier is available
83+
elsewhere:
84+
85+
```ini
86+
[audio]
87+
mixer = nad
88+
89+
[nad]
90+
port = /dev/ttyUSB3
91+
```
92+
93+
Configuration example with full configuration::
94+
95+
```ini
96+
[audio]
97+
mixer = nad
98+
99+
[nad]
100+
port = /dev/ttyUSB0
101+
source = aux
102+
speakers-a = true
103+
speakers-b = false
104+
```
105+
106+
107+
## Project resources
108+
109+
- [Source code](https://github.com/mopidy/mopidy-nad)
110+
- [Issues](https://github.com/mopidy/mopidy-nad/issues)
111+
- [Releases](https://github.com/mopidy/mopidy-nad/releases)
112+
113+
114+
## Development
115+
116+
### Set up development environment
117+
118+
Clone the repo using, e.g. using [gh](https://cli.github.com/):
119+
120+
```sh
121+
gh repo clone mopidy/mopidy-nad
122+
```
123+
124+
Enter the directory, and install dependencies using [uv](https://docs.astral.sh/uv/):
125+
126+
```sh
127+
cd mopidy-nad/
128+
uv sync
129+
```
130+
131+
### Running tests
132+
133+
To run all tests and linters in isolated environments, use
134+
[tox](https://tox.wiki/):
135+
136+
```sh
137+
tox
138+
```
139+
140+
To only run tests, use [pytest](https://pytest.org/):
141+
142+
```sh
143+
pytest
144+
```
145+
146+
To format the code, use [ruff](https://docs.astral.sh/ruff/):
147+
148+
```sh
149+
ruff format .
150+
```
151+
152+
To check for lints with ruff, run:
153+
154+
```sh
155+
ruff check .
156+
```
157+
158+
To check for type errors, use [pyright](https://microsoft.github.io/pyright/):
159+
160+
```sh
161+
pyright .
162+
```
163+
164+
### Making a release
165+
166+
To make a release to PyPI, go to the project's [GitHub releases
167+
page](https://github.com/mopidy/mopidy-nad/releases)
168+
and click the "Draft a new release" button.
169+
170+
In the "choose a tag" dropdown, select the tag you want to release or create a
171+
new tag, e.g. `v0.1.0`. Add a title, e.g. `v0.1.0`, and a description of the changes.
172+
173+
Decide if the release is a pre-release (alpha, beta, or release candidate) or
174+
should be marked as the latest release, and click "Publish release".
175+
176+
Once the release is created, the `release.yml` GitHub Action will automatically
177+
build and publish the release to
178+
[PyPI](https://pypi.org/project/mopidy-nad/).
179+
180+
181+
## Credits
182+
183+
- Original author: [Stein Magnus Jodal](https://github.com/jodal)
184+
- Current maintainer: None. Maintainer wanted, see section above.
185+
- [Contributors](https://github.com/mopidy/mopidy-nad/graphs/contributors)

0 commit comments

Comments
 (0)