1{ lib
2, aiohttp
3, aresponses
4, buildPythonPackage
5, fetchFromGitHub
6, fetchpatch
7, poetry-core
8, pytest-asyncio
9, pytestCheckHook
10, pythonOlder
11, yarl
12}:
13
14buildPythonPackage rec {
15 pname = "cemm";
16 version = "0.5.1";
17 format = "pyproject";
18
19 disabled = pythonOlder "3.9";
20
21 src = fetchFromGitHub {
22 owner = "klaasnicolaas";
23 repo = "python-cemm";
24 rev = "refs/tags/v${version}";
25 hash = "sha256-BorgGHxoEeIGyJKqe9mFRDpcGHhi6/8IV7ubEI8yQE4=";
26 };
27
28 patches = [
29 # https://github.com/klaasnicolaas/python-cemm/pull/360
30 (fetchpatch {
31 name = "remove-setuptools-dependency.patch";
32 url = "https://github.com/klaasnicolaas/python-cemm/commit/1e373dac078f18563264e6733baf6a93962cac4b.patch";
33 hash = "sha256-DVNn4BZwi8yNpKFmzt7YSYhzzB4vaAyrd/My8TtYzj0=";
34 })
35 ];
36
37 postPatch = ''
38 substituteInPlace pyproject.toml \
39 --replace '"0.0.0"' '"${version}"' \
40 --replace 'addopts = "--cov"' ""
41 '';
42
43 nativeBuildInputs = [
44 poetry-core
45 ];
46
47 propagatedBuildInputs = [
48 aiohttp
49 yarl
50 ];
51
52 __darwinAllowLocalNetworking = true;
53
54 nativeCheckInputs = [
55 aresponses
56 pytest-asyncio
57 pytestCheckHook
58 ];
59
60 pythonImportsCheck = [
61 "cemm"
62 ];
63
64 meta = with lib; {
65 description = "Module for interacting with CEMM devices";
66 homepage = "https://github.com/klaasnicolaas/python-cemm";
67 changelog = "https://github.com/klaasnicolaas/python-cemm/releases/tag/v${version}";
68 license = with licenses; [ mit ];
69 maintainers = with maintainers; [ fab ];
70 };
71}