2017-07-21 14:22:15 +01:00
|
|
|
{ stdenv,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchPypi,
|
|
|
|
isPy3k,
|
|
|
|
pythonOlder,
|
|
|
|
lib,
|
|
|
|
requests,
|
|
|
|
future,
|
|
|
|
enum34 }:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "linode-api";
|
2017-07-23 11:22:58 +01:00
|
|
|
version = "4.1.1b2";
|
2017-07-21 14:22:15 +01:00
|
|
|
name = "${pname}-${version}";
|
|
|
|
|
|
|
|
disabled = (pythonOlder "2.7");
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ requests ]
|
|
|
|
++ stdenv.lib.optionals (!isPy3k) [ future ]
|
|
|
|
++ stdenv.lib.optionals (pythonOlder "3.4") [ enum34 ];
|
|
|
|
|
2017-07-23 11:23:28 +01:00
|
|
|
postPatch = (stdenv.lib.optionalString (isPy3k) ''
|
|
|
|
sed -i -e '/"future",/d' setup.py
|
|
|
|
'') + (stdenv.lib.optionalString (!pythonOlder "3.4") ''
|
|
|
|
sed -i -e '/"enum34",/d' setup.py
|
|
|
|
'');
|
|
|
|
|
2017-07-21 14:22:15 +01:00
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2017-07-23 11:22:58 +01:00
|
|
|
sha256 = "1lfqsll3wv1wzn98ymmcbw0yawj8ab3mxniws6kaxf99jd4a0xp4";
|
2017-07-21 14:22:15 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "https://github.com/linode/python-linode-api";
|
|
|
|
description = "The official python library for the Linode API v4 in python.";
|
|
|
|
license = lib.licenses.bsd3;
|
|
|
|
maintainers = with lib.maintainers; [ glenns ];
|
|
|
|
};
|
|
|
|
}
|