1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, isPy3k
5, jsonpickle
6, mock
7, pytest
8, pytestCheckHook
9, requests
10, responses
11}:
12
13buildPythonPackage rec {
14 pname = "python-digitalocean";
15 version = "1.17.0";
16
17 src = fetchFromGitHub {
18 owner = "koalalorenzo";
19 repo = pname;
20 rev = "v${version}";
21 sha256 = "1c50ka4y712rr551gq3kdfw7fgfxr4w837sww6yy683yz7m1d1h8";
22 };
23
24 propagatedBuildInputs = [
25 jsonpickle
26 requests
27 ];
28
29 dontUseSetuptoolsCheck = true;
30
31 nativeCheckInputs = [
32 pytest
33 pytestCheckHook
34 responses
35 ] ++ lib.optionals (!isPy3k) [
36 mock
37 ];
38
39 preCheck = ''
40 cd digitalocean
41 '';
42
43 # Test tries to access the network
44 disabledTests = ["TestFirewall"];
45
46 pythonImportsCheck = [ "digitalocean" ];
47
48 meta = with lib; {
49 description = "Python API to manage Digital Ocean Droplets and Images";
50 homepage = "https://github.com/koalalorenzo/python-digitalocean";
51 license = with licenses; [ lgpl3Only ];
52 maintainers = with maintainers; [ kiwi teh ];
53 };
54}