2021-02-05 17:12:51 +00:00
|
|
|
{
|
2020-04-24 23:36:52 +00:00
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
pythonOlder,
|
|
|
|
lib,
|
|
|
|
requests,
|
|
|
|
future,
|
|
|
|
enum34,
|
|
|
|
mock }:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "linode-api";
|
|
|
|
version = "4.1.8b1"; # NOTE: this is a beta, and the API may change in future versions.
|
|
|
|
|
|
|
|
disabled = (pythonOlder "2.7");
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ requests future ]
|
2021-02-05 17:12:51 +00:00
|
|
|
++ lib.optionals (pythonOlder "3.4") [ enum34 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
postPatch = (lib.optionalString (!pythonOlder "3.4") ''
|
2020-04-24 23:36:52 +00:00
|
|
|
sed -i -e '/"enum34",/d' setup.py
|
|
|
|
'');
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
checkInputs = [ mock ];
|
|
|
|
|
|
|
|
# Sources from Pypi exclude test fixtures
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
rev = "v${version}";
|
|
|
|
owner = "linode";
|
|
|
|
repo = "python-linode-api";
|
|
|
|
sha256 = "0qfqn92fr876dncwbkf2vhm90hnf7lwpg80hzwyzyzwz1hcngvjg";
|
|
|
|
};
|
|
|
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|