1{ lib
2, buildPythonPackage
3, pythonOlder
4, fetchFromGitHub
5, unasync
6, boto3
7, botocore
8, requests
9, aiohttp
10, pyquery
11, loguru
12}:
13
14buildPythonPackage rec {
15 pname = "pyhiveapi";
16 version = "0.4.3";
17
18 format = "pyproject";
19
20 disabled = pythonOlder "3.6";
21
22 src = fetchFromGitHub {
23 owner = "Pyhass";
24 repo = "Pyhiveapi";
25 rev = "v${version}";
26 sha256 = "sha256-SCMASYBOdq9nko5RSQ5BEbRLjOB4FlgwOKwdDggiOv8=";
27 };
28
29 postPatch = ''
30 substituteInPlace requirements.txt \
31 --replace "pre-commit" ""
32 '';
33
34 nativeBuildInputs = [
35 unasync
36 ];
37
38 propagatedBuildInputs = [
39 boto3
40 botocore
41 requests
42 aiohttp
43 pyquery
44 loguru
45 ];
46
47 # tests are not functional yet
48 doCheck = false;
49
50 postBuild = ''
51 # pyhiveapi accesses $HOME upon importing
52 export HOME=$TMPDIR
53 '';
54
55 pythonImportsCheck = [ "pyhiveapi" ];
56
57 meta = with lib; {
58 description = "Python library to interface with the Hive API";
59 homepage = "https://github.com/Pyhass/Pyhiveapi";
60 license = licenses.mit;
61 maintainers = with maintainers; [ dotlambda ];
62 };
63}