nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pytestCheckHook
5, pythonOlder
6, requests
7, requests-mock
8}:
9
10buildPythonPackage rec {
11 pname = "nexia";
12 version = "0.9.13";
13 format = "setuptools";
14
15 disabled = pythonOlder "3.5";
16
17 src = fetchFromGitHub {
18 owner = "bdraco";
19 repo = pname;
20 rev = version;
21 sha256 = "sha256-0VG8tSwbVTIIsQYAEwzQfXLTDy4df/nS/rbHjYo7xf0=";
22 };
23
24 propagatedBuildInputs = [
25 requests
26 ];
27
28 checkInputs = [
29 requests-mock
30 pytestCheckHook
31 ];
32
33 postPatch = ''
34 substituteInPlace setup.py \
35 --replace '"pytest-runner",' ""
36 '';
37
38 pythonImportsCheck = [
39 "nexia"
40 ];
41
42 meta = with lib; {
43 description = "Python module for Nexia thermostats";
44 homepage = "https://github.com/bdraco/nexia";
45 license = with licenses; [ asl20 ];
46 maintainers = with maintainers; [ fab ];
47 };
48}