Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
_commit: v2.2.0
_src_path: gh:mopidy/mopidy-ext-template
author_email: git@matthewgamble.net
author_full_name: Matthew Gamble
dist_name: mopidy-api-explorer
ext_name: api_explorer
github_username: mopidy
short_description: Mopidy extension which lets you explore the JSON-RPC API
44 changes: 32 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,57 @@ on:
push:
branches:
- main
workflow_dispatch:

jobs:
build:
name: Build
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
- uses: hynek/build-and-inspect-python-package@v2

main:
strategy:
fail-fast: false
matrix:
include:
- name: "Lint: check-manifest"
python: "3.11"
tox: check-manifest
- name: "Lint: flake8"
python: "3.11"
tox: flake8
# - name: "pytest (3.13)"
# python: "3.13"
# tox: "3.13"
# - name: "pytest (3.14)"
# python: "3.14"
# tox: "3.14"
# coverage: true
- name: "pyright"
python: "3.14"
tox: "pyright"
- name: "ruff check"
python: "3.14"
tox: "ruff-check"
- name: "ruff format"
python: "3.14"
tox: "ruff-format"

name: ${{ matrix.name }}
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
container: ghcr.io/mopidy/ci:latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v6
- name: Fix home dir permissions to enable pip caching
run: chown -R root /github/home
- uses: actions/setup-python@v4
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python }}
cache: pip
cache-dependency-path: setup.cfg
- run: python -m pip install pygobject tox
allow-prereleases: true
- run: python -m pip install tox
- run: python -m tox -e ${{ matrix.tox }}
if: ${{ ! matrix.coverage }}
- run: python -m tox -e ${{ matrix.tox }} -- --cov-report=xml
if: ${{ matrix.coverage }}
- uses: codecov/codecov-action@v3
- uses: codecov/codecov-action@v5
if: ${{ matrix.coverage }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
28 changes: 14 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ on:

jobs:
release:
runs-on: ubuntu-20.04

runs-on: ubuntu-24.04
environment:
name: pypi
url: https://pypi.org/project/mopidy-api-explorer/
permissions:
id-token: write
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: "Install dependencies"
run: python3 -m pip install build
- name: "Build package"
run: python3 -m build
- uses: pypa/gh-action-pypi-publish@v1.13.0
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
- uses: actions/checkout@v6
- uses: hynek/build-and-inspect-python-package@v2
id: build
- uses: actions/download-artifact@v4
with:
name: ${{ steps.build.outputs.artifact-name }}
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
10 changes: 5 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
*.pyc
*.egg-info/
/*.lock
/.*_cache/
/.coverage
/.mypy_cache/
/.pytest_cache/
/.tox/
/*.egg-info
/.venv/
/build/
/dist/
/MANIFEST
__pycache__/
13 changes: 0 additions & 13 deletions MANIFEST.in

This file was deleted.

105 changes: 105 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# mopidy-api-explorer

[![Latest PyPI version](https://img.shields.io/pypi/v/mopidy-api-explorer)](https://pypi.org/p/mopidy-api-explorer)
[![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)
[![Test coverage](https://img.shields.io/codecov/c/gh/mopidy/mopidy-api-explorer)](https://codecov.io/gh/mopidy/mopidy-api-explorer)

[Mopidy](https://mopidy.com/) extension which lets you explore the JSON-RPC API.


## Installation

Install by running:

```sh
python3 -m pip install mopidy-api-explorer
```


## Usage

Once the extension is installed, Mopidy must be restarted to detect the extension.
After restarting Mopidy, visit the following URL to explore the Mopidy JSON-RPC API:

http://localhost:6680/api_explorer/


## Project resources

- [Source code](https://github.com/mopidy/mopidy-api-explorer)
- [Issues](https://github.com/mopidy/mopidy-api-explorer/issues)
- [Releases](https://github.com/mopidy/mopidy-api-explorer/releases)


## Development

### Set up development environment

Clone the repo using, e.g. using [gh](https://cli.github.com/):

```sh
gh repo clone mopidy/mopidy-api-explorer
```

Enter the directory, and install dependencies using [uv](https://docs.astral.sh/uv/):

```sh
cd mopidy-api-explorer/
uv sync
```

### Running tests

To run all tests and linters in isolated environments, use
[tox](https://tox.wiki/):

```sh
tox
```

To only run tests, use [pytest](https://pytest.org/):

```sh
pytest
```

To format the code, use [ruff](https://docs.astral.sh/ruff/):

```sh
ruff format .
```

To check for lints with ruff, run:

```sh
ruff check .
```

To check for type errors, use [pyright](https://microsoft.github.io/pyright/):

```sh
pyright .
```

### Making a release

To make a release to PyPI, go to the project's [GitHub releases
page](https://github.com/mopidy/mopidy-api-explorer/releases)
and click the "Draft a new release" button.

In the "choose a tag" dropdown, select the tag you want to release or create a
new tag, e.g. `v0.1.0`. Add a title, e.g. `v0.1.0`, and a description of the changes.

Decide if the release is a pre-release (alpha, beta, or release candidate) or
should be marked as the latest release, and click "Publish release".

Once the release is created, the `release.yml` GitHub Action will automatically
build and publish the release to
[PyPI](https://pypi.org/project/mopidy-api-explorer/).


## Credits

- Original author: [Janes Troha](https://github.com/dz0ny)
- Current maintainer: [Matthew Gamble](https://github.com/djmattyg007)
- [Contributors](https://github.com/mopidy/mopidy-api-explorer/graphs/contributors)
46 changes: 0 additions & 46 deletions README.rst

This file was deleted.

26 changes: 0 additions & 26 deletions mopidy_api_explorer/__init__.py

This file was deleted.

Loading