nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 fetchpatch,
6 aiohttp,
7 netifaces,
8 pytest-aio,
9 pytest-asyncio,
10 pytestCheckHook,
11 setuptools-scm,
12}:
13
14buildPythonPackage rec {
15 pname = "python-izone";
16 version = "1.2.9";
17 pyproject = true;
18
19 src = fetchFromGitHub {
20 owner = "Swamp-Ig";
21 repo = "pizone";
22 tag = "v${version}";
23 hash = "sha256-0rj+tKn2pbFe+nczTMGLwIwmc4jCznGGF4/IMjlEvQg=";
24 };
25
26 patches = [
27 # https://github.com/Swamp-Ig/pizone/pull/26
28 (fetchpatch {
29 name = "replace-async-timeout-with-asyncio.timeout.patch";
30 url = "https://github.com/Swamp-Ig/pizone/commit/776a7c5682ecd1b75a0b36dea71c914c25476a77.patch";
31 hash = "sha256-Cl71BErInSPtFNbPaV7E/LEDZPMuFNGKA8i5e+C3BMA=";
32 })
33 ];
34
35 postPatch = ''
36 substituteInPlace pyproject.toml \
37 --replace-fail "setuptools_scm[toml] >= 4, <6" "setuptools-scm[toml]" \
38 --replace-fail '"setuptools_scm_git_archive",' ""
39 '';
40
41 build-system = [ setuptools-scm ];
42
43 dependencies = [
44 aiohttp
45 netifaces
46 ];
47
48 nativeCheckInputs = [
49 pytest-aio
50 pytest-asyncio
51 pytestCheckHook
52 ];
53
54 doCheck = false; # most tests access network
55
56 pythonImportsCheck = [ "pizone" ];
57
58 meta = {
59 description = "Python interface to the iZone airconditioner controller";
60 homepage = "https://github.com/Swamp-Ig/pizone";
61 license = lib.licenses.gpl3Plus;
62 maintainers = with lib.maintainers; [ dotlambda ];
63 };
64}