nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 setuptools,
8
9 # dependencies
10 mashumaro,
11 orjson,
12
13 # tests
14 pytestCheckHook,
15 pytest-cov-stub,
16
17 # reverse dependencies
18 music-assistant-client,
19}:
20
21buildPythonPackage rec {
22 pname = "music-assistant-models";
23 # Must be compatible with music-assistant-client package
24 # nixpkgs-update: no auto update
25 version = "1.1.89";
26 pyproject = true;
27
28 src = fetchFromGitHub {
29 owner = "music-assistant";
30 repo = "models";
31 tag = version;
32 hash = "sha256-/eNCgAB5G8g1r2fcW27lySEqg+q/1bJvwwyntigGWjo=";
33 };
34
35 postPatch = ''
36 substituteInPlace pyproject.toml \
37 --replace-fail "0.0.0" "${version}"
38 '';
39
40 build-system = [ setuptools ];
41
42 dependencies = [
43 mashumaro
44 orjson
45 ];
46
47 nativeCheckInputs = [
48 pytest-cov-stub
49 pytestCheckHook
50 ];
51
52 pythonImportsCheck = [
53 "music_assistant_models"
54 ];
55
56 passthru.tests = {
57 inherit music-assistant-client;
58 };
59
60 meta = {
61 description = "Models used by Music Assistant (shared by client and server";
62 homepage = "https://github.com/music-assistant/models";
63 changelog = "https://github.com/music-assistant/models/releases/tag/${src.tag}";
64 license = lib.licenses.asl20;
65 maintainers = [ ];
66 };
67}