2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonApplication
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchurl
|
|
|
|
, terminaltables
|
|
|
|
, colorclass
|
|
|
|
, requests
|
|
|
|
, pyyaml
|
|
|
|
, setuptools
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
spec = fetchurl {
|
2021-04-12 18:23:04 +00:00
|
|
|
url = "https://raw.githubusercontent.com/linode/linode-api-docs/v4.89.0/openapi.yaml";
|
|
|
|
sha256 = "sha256-R7Dmq8ifGEjh47ftuoGrbymYBsPCj/ULz0j1OqJDcwY=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
buildPythonApplication rec {
|
|
|
|
pname = "linode-cli";
|
2021-04-12 18:23:04 +00:00
|
|
|
version = "5.0.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "linode";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2021-04-12 18:23:04 +00:00
|
|
|
sha256 = "sha256-zelopRaHaDCnbYA/y7dNMBh70g0+wuc6t9LH/VLaUIk=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# remove need for git history
|
|
|
|
prePatch = ''
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "version=get_version()," "version='${version}',"
|
|
|
|
'';
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
terminaltables
|
|
|
|
colorclass
|
|
|
|
requests
|
|
|
|
pyyaml
|
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
|
|
|
postConfigure = ''
|
|
|
|
python3 -m linodecli bake ${spec} --skip-config
|
|
|
|
cp data-3 linodecli/
|
|
|
|
'';
|
|
|
|
|
|
|
|
# requires linode access token for unit tests, and running executable
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/linode/linode-cli";
|
|
|
|
description = "The Linode Command Line Interface";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ ryantm ];
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|