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 version = "1.1.51"; # Must be compatible with music-assistant-client package
24 pyproject = true;
25
26 src = fetchFromGitHub {
27 owner = "music-assistant";
28 repo = "models";
29 tag = version;
30 hash = "sha256-vx0GlW99qDpSRDihP0dYhwgksPdCNj82SATo5TpITa4=";
31 };
32
33 postPatch = ''
34 substituteInPlace pyproject.toml \
35 --replace-fail "0.0.0" "${version}"
36 '';
37
38 build-system = [ setuptools ];
39
40 dependencies = [
41 mashumaro
42 orjson
43 ];
44
45 nativeCheckInputs = [
46 pytest-cov-stub
47 pytestCheckHook
48 ];
49
50 pythonImportsCheck = [
51 "music_assistant_models"
52 ];
53
54 passthru.tests = {
55 inherit music-assistant-client;
56 };
57
58 meta = {
59 description = "Models used by Music Assistant (shared by client and server";
60 homepage = "https://github.com/music-assistant/models";
61 changelog = "https://github.com/music-assistant/models/blob/${src.tag}/CHANGELOG.md";
62 license = lib.licenses.asl20;
63 maintainers = with lib.maintainers; [ ];
64 };
65}