-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: Split off Music Assistant Client into its own package
- Loading branch information
1 parent
7e3b948
commit 9d5cdb7
Showing
22 changed files
with
2,249 additions
and
1 deletion.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: daily | ||
- package-ecosystem: "pip" | ||
directory: "/" | ||
schedule: | ||
interval: weekly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", | ||
"draft": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
".": "1.0.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: Auto approve Dependabot PR's | ||
|
||
on: pull_request_target | ||
|
||
jobs: | ||
auto-approve: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: write | ||
if: github.actor == 'dependabot[bot]' | ||
steps: | ||
- uses: hmarr/auto-approve-action@v4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Release Notes drafter (release-please) | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
release-please: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
version: ${{ steps.release.outputs.tag_name }} | ||
release_created: ${{ steps.release.outputs.release_created }} | ||
steps: | ||
- uses: googleapis/release-please-action@v4 | ||
id: release | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
release-type: simple | ||
manifest-file: .github/workflows/.release-please-manifest.json | ||
config-file: .github/workflows/.release-please-config.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
name: Publish releases | ||
|
||
on: | ||
release: | ||
types: [released] | ||
|
||
env: | ||
PYTHON_VERSION: "3.11" | ||
BASE_IMAGE_VERSION_STABLE: "1.1.2" | ||
BASE_IMAGE_VERSION_BETA: "1.1.2" | ||
|
||
jobs: | ||
build-artifact: | ||
name: Builds python artifact uploads to Github Artifact store and PyPi | ||
runs-on: ubuntu-latest | ||
outputs: | ||
version: ${{ steps.vars.outputs.tag }} | ||
steps: | ||
- uses: actions/[email protected] | ||
- name: Get tag | ||
id: vars | ||
run: >- | ||
echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT | ||
- name: Validate version number | ||
run: >- | ||
if [[ "${{ github.event.release.prerelease }}" == "true" ]]; then | ||
if ! [[ "${{ steps.vars.outputs.tag }}" =~ "b" || "${{ steps.vars.outputs.tag }}" =~ "rc" ]]; then | ||
echo "Pre-release: Tag is missing beta suffix (${{ steps.vars.outputs.tag }})" | ||
exit 1 | ||
fi | ||
else | ||
if [[ "${{ steps.vars.outputs.tag }}" =~ "b" || "${{ steps.vars.outputs.tag }}" =~ "rc" ]]; then | ||
echo "Release: Tag must not have a beta (or rc) suffix (${{ steps.vars.outputs.tag }})" | ||
exit 1 | ||
fi | ||
fi | ||
- name: Set up Python ${{ env.PYTHON_VERSION }} | ||
uses: actions/[email protected] | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
- name: Install build | ||
run: >- | ||
pip install build tomli tomli-w | ||
- name: Set Python project version from tag | ||
shell: python | ||
run: |- | ||
import tomli | ||
import tomli_w | ||
with open("pyproject.toml", "rb") as f: | ||
pyproject = tomli.load(f) | ||
pyproject["project"]["version"] = "${{ steps.vars.outputs.tag }}" | ||
with open("pyproject.toml", "wb") as f: | ||
tomli_w.dump(pyproject, f) | ||
- name: Build python package | ||
run: >- | ||
python3 -m build | ||
- name: Upload distributions | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: release-dists | ||
path: dist/ | ||
- name: Publish release to PyPI | ||
uses: pypa/[email protected] | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_TOKEN }} | ||
|
||
# - name: Create Server + Client repo PR (TODO!) | ||
# uses: music-assistant/frontend-release-pr-action@main | ||
# with: | ||
# github_token: ${{ secrets.PRIVILEGED_GITHUB_TOKEN }} | ||
# new_release_version: ${{ env.version }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# This workflow will install Python dependencies, run tests and lint | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
|
||
name: Test | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
continue-on-error: true | ||
|
||
steps: | ||
- name: Check out code from GitHub | ||
uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/[email protected] | ||
with: | ||
python-version: "3.11" | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip build setuptools | ||
pip install . .[test] | ||
- name: Lint/test with pre-commit | ||
run: SKIP=no-commit-to-branch pre-commit run --all-files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
repos: | ||
- repo: local | ||
hooks: | ||
- id: ruff-check | ||
name: 🐶 Ruff Linter | ||
language: system | ||
types: [python] | ||
entry: ./run-in-env.sh ruff check --fix | ||
require_serial: true | ||
stages: [pre-commit, pre-push, manual] | ||
- id: ruff-format | ||
name: 🐶 Ruff Formatter | ||
language: system | ||
types: [python] | ||
entry: ./run-in-env.sh ruff format | ||
require_serial: true | ||
stages: [pre-commit, pre-push, manual] | ||
- id: check-ast | ||
name: 🐍 Check Python AST | ||
language: system | ||
types: [python] | ||
entry: ./run-in-env.sh check-ast | ||
- id: check-case-conflict | ||
name: 🔠 Check for case conflicts | ||
language: system | ||
entry: ./run-in-env.sh check-case-conflict | ||
- id: check-docstring-first | ||
name: ℹ️ Check docstring is first | ||
language: system | ||
types: [python] | ||
entry: ./run-in-env.sh check-docstring-first | ||
- id: check-executables-have-shebangs | ||
name: 🧐 Check that executables have shebangs | ||
language: system | ||
types: [text, executable] | ||
entry: ./run-in-env.sh check-executables-have-shebangs | ||
stages: [pre-commit, pre-push, manual] | ||
- id: check-merge-conflict | ||
name: 💥 Check for merge conflicts | ||
language: system | ||
types: [text] | ||
entry: ./run-in-env.sh check-merge-conflict | ||
- id: check-symlinks | ||
name: 🔗 Check for broken symlinks | ||
language: system | ||
types: [symlink] | ||
entry: ./run-in-env.sh check-symlinks | ||
- id: check-toml | ||
name: ✅ Check TOML files | ||
language: system | ||
types: [toml] | ||
entry: ./run-in-env.sh check-toml | ||
- id: codespell | ||
name: ✅ Check code for common misspellings | ||
language: system | ||
types: [text] | ||
entry: ./run-in-env.sh codespell | ||
- id: detect-private-key | ||
name: 🕵️ Detect Private Keys | ||
language: system | ||
types: [text] | ||
entry: ./run-in-env.sh detect-private-key | ||
- id: end-of-file-fixer | ||
name: ⮐ Fix End of Files | ||
language: system | ||
types: [text] | ||
entry: ./run-in-env.sh end-of-file-fixer | ||
stages: [pre-commit, pre-push, manual] | ||
- id: trailing-whitespace | ||
name: ✄ Trim Trailing Whitespace | ||
language: system | ||
types: [text] | ||
entry: ./run-in-env.sh trailing-whitespace-fixer | ||
stages: [pre-commit, pre-push, manual] | ||
- id: mypy | ||
name: mypy | ||
entry: ./run-in-env.sh mypy | ||
language: script | ||
types: [python] | ||
require_serial: true | ||
pass_filenames: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
# client | ||
# Music Assistant Client | ||
|
||
Python client to interact with the Music Assistant Server API |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
"""Music Assistant Client: Manage a Music Assistant server remotely.""" | ||
|
||
from .client import MusicAssistantClient # noqa: F401 |
Oops, something went wrong.