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