Skip to content

Commit 5c6cc7d

Browse files
authored
Merge pull request #12 from mopidy/ext-template
chore: Update to mopidy-ext-template v2.2.0
2 parents e5bc628 + d0c6c0b commit 5c6cc7d

24 files changed

+327
-214
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: [email protected]
4+
author_full_name: Matthew Gamble
5+
dist_name: mopidy-api-explorer
6+
ext_name: api_explorer
7+
github_username: mopidy
8+
short_description: Mopidy extension which lets you explore the JSON-RPC API

.github/workflows/ci.yml

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,37 +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: "Lint: check-manifest"
16-
python: "3.11"
17-
tox: check-manifest
18-
- name: "Lint: flake8"
19-
python: "3.11"
20-
tox: flake8
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"
29+
# coverage: true
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"
2139

2240
name: ${{ matrix.name }}
23-
runs-on: ubuntu-22.04
41+
runs-on: ubuntu-24.04
2442
container: ghcr.io/mopidy/ci:latest
2543

2644
steps:
27-
- uses: actions/checkout@v3
45+
- uses: actions/checkout@v6
2846
- name: Fix home dir permissions to enable pip caching
2947
run: chown -R root /github/home
30-
- uses: actions/setup-python@v4
48+
- uses: actions/setup-python@v6
3149
with:
3250
python-version: ${{ matrix.python }}
3351
cache: pip
34-
cache-dependency-path: setup.cfg
35-
- run: python -m pip install pygobject tox
52+
allow-prereleases: true
53+
- run: python -m pip install tox
3654
- run: python -m tox -e ${{ matrix.tox }}
3755
if: ${{ ! matrix.coverage }}
3856
- run: python -m tox -e ${{ matrix.tox }} -- --cov-report=xml
3957
if: ${{ matrix.coverage }}
40-
- uses: codecov/codecov-action@v3
58+
- uses: codecov/codecov-action@v5
4159
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-api-explorer/
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/[email protected]
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 & 13 deletions
This file was deleted.

README.md

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# mopidy-api-explorer
2+
3+
[![Latest PyPI version](https://img.shields.io/pypi/v/mopidy-api-explorer)](https://pypi.org/p/mopidy-api-explorer)
4+
[![CI build status](https://img.shields.io/github/actions/workflow/status/mopidy/mopidy-api-explorer/ci.yml)](https://github.com/mopidy/mopidy-api-explorer/actions/workflows/ci.yml)
5+
[![Test coverage](https://img.shields.io/codecov/c/gh/mopidy/mopidy-api-explorer)](https://codecov.io/gh/mopidy/mopidy-api-explorer)
6+
7+
[Mopidy](https://mopidy.com/) extension which lets you explore the JSON-RPC API.
8+
9+
10+
## Installation
11+
12+
Install by running:
13+
14+
```sh
15+
python3 -m pip install mopidy-api-explorer
16+
```
17+
18+
19+
## Usage
20+
21+
Once the extension is installed, Mopidy must be restarted to detect the extension.
22+
After restarting Mopidy, visit the following URL to explore the Mopidy JSON-RPC API:
23+
24+
http://localhost:6680/api_explorer/
25+
26+
27+
## Project resources
28+
29+
- [Source code](https://github.com/mopidy/mopidy-api-explorer)
30+
- [Issues](https://github.com/mopidy/mopidy-api-explorer/issues)
31+
- [Releases](https://github.com/mopidy/mopidy-api-explorer/releases)
32+
33+
34+
## Development
35+
36+
### Set up development environment
37+
38+
Clone the repo using, e.g. using [gh](https://cli.github.com/):
39+
40+
```sh
41+
gh repo clone mopidy/mopidy-api-explorer
42+
```
43+
44+
Enter the directory, and install dependencies using [uv](https://docs.astral.sh/uv/):
45+
46+
```sh
47+
cd mopidy-api-explorer/
48+
uv sync
49+
```
50+
51+
### Running tests
52+
53+
To run all tests and linters in isolated environments, use
54+
[tox](https://tox.wiki/):
55+
56+
```sh
57+
tox
58+
```
59+
60+
To only run tests, use [pytest](https://pytest.org/):
61+
62+
```sh
63+
pytest
64+
```
65+
66+
To format the code, use [ruff](https://docs.astral.sh/ruff/):
67+
68+
```sh
69+
ruff format .
70+
```
71+
72+
To check for lints with ruff, run:
73+
74+
```sh
75+
ruff check .
76+
```
77+
78+
To check for type errors, use [pyright](https://microsoft.github.io/pyright/):
79+
80+
```sh
81+
pyright .
82+
```
83+
84+
### Making a release
85+
86+
To make a release to PyPI, go to the project's [GitHub releases
87+
page](https://github.com/mopidy/mopidy-api-explorer/releases)
88+
and click the "Draft a new release" button.
89+
90+
In the "choose a tag" dropdown, select the tag you want to release or create a
91+
new tag, e.g. `v0.1.0`. Add a title, e.g. `v0.1.0`, and a description of the changes.
92+
93+
Decide if the release is a pre-release (alpha, beta, or release candidate) or
94+
should be marked as the latest release, and click "Publish release".
95+
96+
Once the release is created, the `release.yml` GitHub Action will automatically
97+
build and publish the release to
98+
[PyPI](https://pypi.org/project/mopidy-api-explorer/).
99+
100+
101+
## Credits
102+
103+
- Original author: [Janes Troha](https://github.com/dz0ny)
104+
- Current maintainer: [Matthew Gamble](https://github.com/djmattyg007)
105+
- [Contributors](https://github.com/mopidy/mopidy-api-explorer/graphs/contributors)

README.rst

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

mopidy_api_explorer/__init__.py

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

0 commit comments

Comments
 (0)