From fed463d463c8e3d94da32626da1bacd19e93b95e Mon Sep 17 00:00:00 2001 From: seth Date: Wed, 3 Jul 2024 16:09:38 -0400 Subject: [PATCH 1/5] mopidy-spotify: format with nixfmt --- pkgs/applications/audio/mopidy/spotify.nix | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/pkgs/applications/audio/mopidy/spotify.nix b/pkgs/applications/audio/mopidy/spotify.nix index aac6ec43c305..b2734066c693 100644 --- a/pkgs/applications/audio/mopidy/spotify.nix +++ b/pkgs/applications/audio/mopidy/spotify.nix @@ -1,4 +1,10 @@ -{ lib, fetchFromGitHub, pythonPackages, mopidy, unstableGitUpdater }: +{ + lib, + fetchFromGitHub, + pythonPackages, + mopidy, + unstableGitUpdater, +}: pythonPackages.buildPythonApplication rec { pname = "mopidy-spotify"; @@ -16,15 +22,11 @@ pythonPackages.buildPythonApplication rec { pythonPackages.responses ]; - nativeBuildInputs = [ - pythonPackages.pytestCheckHook - ]; + nativeBuildInputs = [ pythonPackages.pytestCheckHook ]; pythonImportsCheck = [ "mopidy_spotify" ]; - passthru.updateScript = unstableGitUpdater { - tagPrefix = "v"; - }; + passthru.updateScript = unstableGitUpdater { tagPrefix = "v"; }; meta = with lib; { homepage = "https://github.com/mopidy/mopidy-spotify"; From 1ca6963806e436dfeecb4f03d9fb57dcbbdb96bd Mon Sep 17 00:00:00 2001 From: seth Date: Wed, 3 Jul 2024 16:09:51 -0400 Subject: [PATCH 2/5] mopidy-spotify: adopt --- pkgs/applications/audio/mopidy/spotify.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/audio/mopidy/spotify.nix b/pkgs/applications/audio/mopidy/spotify.nix index b2734066c693..c47c4f207e5d 100644 --- a/pkgs/applications/audio/mopidy/spotify.nix +++ b/pkgs/applications/audio/mopidy/spotify.nix @@ -32,6 +32,6 @@ pythonPackages.buildPythonApplication rec { homepage = "https://github.com/mopidy/mopidy-spotify"; description = "Mopidy extension for playing music from Spotify"; license = licenses.asl20; - maintainers = with maintainers; [ ]; + maintainers = with maintainers; [ getchoo ]; }; } From 67db17ed9080f14d3825f69a33351743706d748e Mon Sep 17 00:00:00 2001 From: seth Date: Wed, 3 Jul 2024 16:11:30 -0400 Subject: [PATCH 3/5] mopidy-spotify: modernize - set `pyproject` explicitly - set `build-system` explicitly - propagatedBuildInputs -> dependencies - https://github.com/NixOS/nixpkgs/issues/208242 --- pkgs/applications/audio/mopidy/spotify.nix | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/pkgs/applications/audio/mopidy/spotify.nix b/pkgs/applications/audio/mopidy/spotify.nix index c47c4f207e5d..b316753c108a 100644 --- a/pkgs/applications/audio/mopidy/spotify.nix +++ b/pkgs/applications/audio/mopidy/spotify.nix @@ -6,9 +6,10 @@ unstableGitUpdater, }: -pythonPackages.buildPythonApplication rec { +pythonPackages.buildPythonApplication { pname = "mopidy-spotify"; version = "4.1.1-unstable-2024-02-27"; + pyproject = true; src = fetchFromGitHub { owner = "mopidy"; @@ -17,21 +18,23 @@ pythonPackages.buildPythonApplication rec { hash = "sha256-RkXDzAbOOll3uCNZ2mFRnjqMkT/NkXOGjywLRTC9i60="; }; - propagatedBuildInputs = [ + build-system = [ pythonPackages.setuptools ]; + + dependencies = [ mopidy pythonPackages.responses ]; - nativeBuildInputs = [ pythonPackages.pytestCheckHook ]; + nativeCheckInputs = [ pythonPackages.pytestCheckHook ]; pythonImportsCheck = [ "mopidy_spotify" ]; passthru.updateScript = unstableGitUpdater { tagPrefix = "v"; }; - meta = with lib; { - homepage = "https://github.com/mopidy/mopidy-spotify"; + meta = { description = "Mopidy extension for playing music from Spotify"; - license = licenses.asl20; - maintainers = with maintainers; [ getchoo ]; + homepage = "https://github.com/mopidy/mopidy-spotify"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ getchoo ]; }; } From beac2a59f95b623a3d4f6b589943ab0483500dfc Mon Sep 17 00:00:00 2001 From: seth Date: Wed, 3 Jul 2024 16:30:51 -0400 Subject: [PATCH 4/5] mopidy-spotify: use nix-update-script for updateScript --- pkgs/applications/audio/mopidy/spotify.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/audio/mopidy/spotify.nix b/pkgs/applications/audio/mopidy/spotify.nix index b316753c108a..956e2790a516 100644 --- a/pkgs/applications/audio/mopidy/spotify.nix +++ b/pkgs/applications/audio/mopidy/spotify.nix @@ -3,7 +3,7 @@ fetchFromGitHub, pythonPackages, mopidy, - unstableGitUpdater, + nix-update-script, }: pythonPackages.buildPythonApplication { @@ -29,7 +29,9 @@ pythonPackages.buildPythonApplication { pythonImportsCheck = [ "mopidy_spotify" ]; - passthru.updateScript = unstableGitUpdater { tagPrefix = "v"; }; + passthru = { + updateScript = nix-update-script { }; + }; meta = { description = "Mopidy extension for playing music from Spotify"; From 03023c3acb3d2b7267ec00c2378741f4e8f83157 Mon Sep 17 00:00:00 2001 From: seth Date: Wed, 3 Jul 2024 16:38:24 -0400 Subject: [PATCH 5/5] mopidy-spotify: 4.1.1-unstable-2024-02-27 -> 5.0.0a2 Diff: https://github.com/mopidy/mopidy-spotify/compare/v4.1.1...v5.0.0a2 Changelog: https://github.com/mopidy/mopidy-spotify/releases/tag/v5.0.0a2 --- pkgs/applications/audio/mopidy/spotify.nix | 32 ++++++++++++++++++---- 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/pkgs/applications/audio/mopidy/spotify.nix b/pkgs/applications/audio/mopidy/spotify.nix index 956e2790a516..d719a03c7cff 100644 --- a/pkgs/applications/audio/mopidy/spotify.nix +++ b/pkgs/applications/audio/mopidy/spotify.nix @@ -6,26 +6,45 @@ nix-update-script, }: -pythonPackages.buildPythonApplication { +pythonPackages.buildPythonApplication rec { pname = "mopidy-spotify"; - version = "4.1.1-unstable-2024-02-27"; + version = "5.0.0a2"; pyproject = true; src = fetchFromGitHub { owner = "mopidy"; repo = "mopidy-spotify"; - rev = "112d4abbb3f5b6477dab796f2824fa42196bfa0a"; - hash = "sha256-RkXDzAbOOll3uCNZ2mFRnjqMkT/NkXOGjywLRTC9i60="; + rev = "refs/tags/v${version}"; + hash = "sha256-QeABG9rQKJ8sIoK38R74N0s5rRG+zws7AZR0xPysdcY="; }; build-system = [ pythonPackages.setuptools ]; dependencies = [ mopidy - pythonPackages.responses + pythonPackages.pykka + pythonPackages.requests ]; - nativeCheckInputs = [ pythonPackages.pytestCheckHook ]; + optional-dependencies = { + lint = with pythonPackages; [ + black + check-manifest + flake8 + flake8-bugbear + isort + ]; + + test = with pythonPackages; [ + pytest + pytest-cov + responses + ]; + + dev = optional-dependencies.lint ++ optional-dependencies.test ++ [ pythonPackages.tox ]; + }; + + nativeCheckInputs = [ pythonPackages.pytestCheckHook ] ++ optional-dependencies.test; pythonImportsCheck = [ "mopidy_spotify" ]; @@ -36,6 +55,7 @@ pythonPackages.buildPythonApplication { meta = { description = "Mopidy extension for playing music from Spotify"; homepage = "https://github.com/mopidy/mopidy-spotify"; + changelog = "https://github.com/mopidy/mopidy-spotify/releases/tag/v${version}"; license = lib.licenses.asl20; maintainers = with lib.maintainers; [ getchoo ]; };