nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 setuptools,
6 requests,
7 pycryptodome,
8 pytest-cov-stub,
9 pytestCheckHook,
10}:
11
12buildPythonPackage rec {
13 pname = "pymitsubishi";
14 version = "0.5.0";
15 pyproject = true;
16
17 src = fetchFromGitHub {
18 owner = "pymitsubishi";
19 repo = "pymitsubishi";
20 tag = "v${version}";
21 hash = "sha256-Y+peVtaPWuvgM+2x7bIuwCicscv6xkZHzqpFSyiJQWQ=";
22 };
23
24 postPatch = ''
25 # make sure pyproject.toml specifies the correct version
26 grep -qF 'version = "${version}"' pyproject.toml
27 '';
28
29 build-system = [ setuptools ];
30
31 dependencies = [
32 requests
33 pycryptodome
34 ];
35
36 nativeCheckInputs = [
37 pytest-cov-stub
38 pytestCheckHook
39 ];
40
41 pythonImportsCheck = [ "pymitsubishi" ];
42
43 meta = {
44 description = "Library for controlling and monitoring Mitsubishi MAC-577IF-2E air conditioners";
45 homepage = "https://github.com/pymitsubishi/pymitsubishi";
46 changelog = "https://github.com/pymitsubishi/pymitsubishi/releases/tag/${src.tag}";
47 license = lib.licenses.mit;
48 maintainers = with lib.maintainers; [ uvnikita ];
49 };
50}