1{ lib
2, stdenv
3, buildPythonPackage
4, fetchFromGitHub
5, fetchpatch
6, pytest-asyncio
7, pytest-timeout
8, pytestCheckHook
9, pythonOlder
10, setuptools
11, wheel
12}:
13
14buildPythonPackage rec {
15 pname = "pypck";
16 version = "0.7.17";
17 format = "pyproject";
18
19 disabled = pythonOlder "3.9";
20
21 src = fetchFromGitHub {
22 owner = "alengwenus";
23 repo = pname;
24 rev = "refs/tags/${version}";
25 hash = "sha256-Vlt4+fRULb9mB0ceRmc7MJ50DnF9DAJPHA8iCbNVvcE=";
26 };
27
28 patches = [
29 # https://github.com/alengwenus/pypck/pull/109
30 (fetchpatch {
31 name = "relax-setuptools-dependency.patch";
32 url = "https://github.com/alengwenus/pypck/commit/17023ebe8082120b1eec086842ca809ec6e9df2b.patch";
33 hash = "sha256-kTu1+IwDrcdqelyK/vfhxw8MQBis5I1jag7YTytKQhs=";
34 })
35 ];
36
37 nativeBuildInputs = [
38 setuptools
39 wheel
40 ];
41
42 nativeCheckInputs = [
43 pytest-asyncio
44 pytest-timeout
45 pytestCheckHook
46 ];
47
48 pytestFlagsArray = [
49 "--asyncio-mode=auto"
50 ];
51
52 disabledTests = lib.optionals stdenv.isDarwin [
53 "test_connection_lost"
54 ];
55
56 __darwinAllowLocalNetworking = true;
57
58 pythonImportsCheck = [
59 "pypck"
60 ];
61
62 meta = with lib; {
63 description = "LCN-PCK library written in Python";
64 homepage = "https://github.com/alengwenus/pypck";
65 changelog = "https://github.com/alengwenus/pypck/releases/tag/${version}";
66 license = with licenses; [ epl20 ];
67 maintainers = with maintainers; [ fab ];
68 };
69}