1{ stdenv,
2 buildPythonPackage,
3 fetchFromGitHub,
4 pythonOlder,
5 lib,
6 requests,
7 future,
8 enum34,
9 mock }:
10
11buildPythonPackage rec {
12 pname = "linode-api";
13 version = "4.1.8b1"; # NOTE: this is a beta, and the API may change in future versions.
14
15 disabled = (pythonOlder "2.7");
16
17 propagatedBuildInputs = [ requests future ]
18 ++ stdenv.lib.optionals (pythonOlder "3.4") [ enum34 ];
19
20 postPatch = (stdenv.lib.optionalString (!pythonOlder "3.4") ''
21 sed -i -e '/"enum34",/d' setup.py
22 '');
23
24 doCheck = true;
25 checkInputs = [ mock ];
26
27 # Sources from Pypi exclude test fixtures
28 src = fetchFromGitHub {
29 rev = "v${version}";
30 owner = "linode";
31 repo = "python-linode-api";
32 sha256 = "0qfqn92fr876dncwbkf2vhm90hnf7lwpg80hzwyzyzwz1hcngvjg";
33 };
34
35 meta = {
36 homepage = "https://github.com/linode/python-linode-api";
37 description = "The official python library for the Linode API v4 in python.";
38 license = lib.licenses.bsd3;
39 maintainers = with lib.maintainers; [ glenns ];
40 };
41}