1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 hatchling,
6 mashumaro,
7 orjson,
8 pytest-asyncio,
9 pytest-cov-stub,
10 pytestCheckHook,
11 pythonOlder,
12 syrupy,
13}:
14
15buildPythonPackage rec {
16 pname = "webrtc-models";
17 version = "0.3.0";
18 pyproject = true;
19
20 disabled = pythonOlder "3.12";
21
22 src = fetchFromGitHub {
23 owner = "home-assistant-libs";
24 repo = "python-webrtc-models";
25 tag = version;
26 hash = "sha256-WZPI7vYlfsihskRtrh4XJGx0JSDwn7JIJ8CL3jlryrA=";
27 };
28
29 postPatch = ''
30 substituteInPlace pyproject.toml \
31 --replace-fail 'version = "0.0.0"' 'version = "${version}"'
32 '';
33
34 pythonRelaxDeps = [ "orjson" ];
35
36 build-system = [ hatchling ];
37
38 dependencies = [
39 mashumaro
40 orjson
41 ];
42
43 nativeCheckInputs = [
44 pytest-asyncio
45 pytest-cov-stub
46 pytestCheckHook
47 syrupy
48 ];
49
50 pythonImportsCheck = [ "webrtc_models" ];
51
52 meta = {
53 description = "WebRTC models as Python dataclasses with mashumaro";
54 homepage = "https://github.com/home-assistant-libs/python-webrtc-models";
55 changelog = "https://github.com/home-assistant-libs/python-webrtc-models/releases/tag/${version}";
56 license = lib.licenses.asl20;
57 maintainers = with lib.maintainers; [ fab ];
58 };
59}