From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id qNITEuQy+mK4RgEAbAwnHQ (envelope-from ) for ; Mon, 15 Aug 2022 13:49:56 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id CJXxEeQy+mI44gAAauVa8A (envelope-from ) for ; Mon, 15 Aug 2022 13:49:56 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 111719748 for ; Mon, 15 Aug 2022 13:49:56 +0200 (CEST) Received: from localhost ([::1]:48770 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oNYbT-0003ga-6H for larch@yhetil.org; Mon, 15 Aug 2022 07:49:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59914) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oNYVn-0008MQ-Kt for guix-patches@gnu.org; Mon, 15 Aug 2022 07:44:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:51310) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oNYVm-0001Su-C7 for guix-patches@gnu.org; Mon, 15 Aug 2022 07:44:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oNYVm-0006oG-8F for guix-patches@gnu.org; Mon, 15 Aug 2022 07:44:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57118] [PATCH v2] gnu: Add linode-cli. References: <20220810141843.21051-1-raingloom@riseup.net> In-Reply-To: <20220810141843.21051-1-raingloom@riseup.net> Resent-From: raingloom Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 15 Aug 2022 11:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57118 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57118@debbugs.gnu.org Cc: Csepp Received: via spool by 57118-submit@debbugs.gnu.org id=B57118.166056380226105 (code B ref 57118); Mon, 15 Aug 2022 11:44:02 +0000 Received: (at 57118) by debbugs.gnu.org; 15 Aug 2022 11:43:22 +0000 Received: from localhost ([127.0.0.1]:41055 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oNYV7-0006mz-Hg for submit@debbugs.gnu.org; Mon, 15 Aug 2022 07:43:21 -0400 Received: from mx0.riseup.net ([198.252.153.6]:39426) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oNYV4-0006mk-QB for 57118@debbugs.gnu.org; Mon, 15 Aug 2022 07:43:19 -0400 Received: from fews2.riseup.net (fews2-pn.riseup.net [10.0.1.84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mail.riseup.net", Issuer "R3" (not verified)) by mx0.riseup.net (Postfix) with ESMTPS id 4M5sq50Yk5z9sxL for <57118@debbugs.gnu.org>; Mon, 15 Aug 2022 11:43:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1660563793; bh=HRQcIWbwofe1+gtlyLgVqgh+8AjbltjeIHFyzgMf9Uo=; h=From:To:Cc:Subject:Date:From; b=PRWQxguMYYqoEVTBp+uWy9qNuY1lMpNc/d4OlO5xP0QduwUHwD83iacbUAELKMkFG +nEOjzetG60PeOZWayP+56w0FjQmgmsnO/E8w3kwBbI8hIF8dgZcu5r9+xeFK8uJ5g /fFMAHd4ik8vcxcEy7HG2+IE34Mdbn9zfaviopyI= X-Riseup-User-ID: 1A27FB2A1BFDF6AB96CBF1AAD8C2ED13446D3F4E47902FAFF6E234DEC9B4A798 Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews2.riseup.net (Postfix) with ESMTPSA id 4M5sq41jTtz1ySb; Mon, 15 Aug 2022 11:43:11 +0000 (UTC) From: raingloom Date: Mon, 15 Aug 2022 13:42:28 +0200 Message-Id: <20220815114227.10424-1-raingloom@riseup.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1660564196; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=JYWPyeVVmrhKrq0DPMYqfykr2j6JOPWmVw2e37aHeBY=; b=JRtm93ccy8oUnZeNbbfA1oi3AR0MIPwRhCFixz1tm3TfaKPE1wcM4CVEG8HuqGZBLQp+YC uDDE3r8PnyT3vl/niEtnmVjZqmXshembKNBmoTBreZMtn/v7WBe7NAgu5wLitNwqVyeLB+ 4hYqotV3Hly1a3IMiNBtOtJWI0iK/KAbfvkrly5bSkmQJP7sO3cYCaBW52h7gl3b1oBCsS UMwXxU+LE0WxqsDBWvOH94x8jGyS4j+X98tPotNp2FwZOnScu0thhSfga4pA2caV1qR5FK BDhlynNp53rKe/r8nGqH62OHFHYXMfHfhm/j5OhZjJbJR40of8uxWHKyXrVvow== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1660564196; a=rsa-sha256; cv=none; b=jc47DZhpXODJlS0vAsX1783IeAgdSDpK0s6GiFSfkzAqwUt/zO3UU9DPeJ946He97ek5YG G8tcSxAMI6ggzQahmV8UM+x8PF/kxLGISLXfD7f2w7UULsVJLLk/dku5vInhGWpRZyNtO7 vByqsKlae0pfaHe1izeCNclDJof/wdaa/GvfmnfCEFLm9HT57YaVIpNugxN+GWgAqmtMDU yhJs1In4BrVVSx70A141PYy/IfyMO9h2YVbqUywOUZMZWPYNkeQ4uAMMqWdE+1IQ4lkhMC pzooSOJqhV2fwGyuAwf0X8vn5/oruKFWtaQTr65BEeOG8an5TFmazjTKsVzlJQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=riseup.net header.s=squak header.b=PRWQxguM; dmarc=fail reason="SPF not aligned (relaxed)" header.from=riseup.net (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 7.54 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=riseup.net header.s=squak header.b=PRWQxguM; dmarc=fail reason="SPF not aligned (relaxed)" header.from=riseup.net (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 111719748 X-Spam-Score: 7.54 X-Migadu-Scanner: scn0.migadu.com X-TUID: JoCTGdP5Gs8z From: Csepp * gnu/packages/python-xyz.scm (linode-cli) (linode-openapi-spec): New variables. --- gnu/packages/python-xyz.scm | 67 +++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index e5326274c0..f299476f47 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -30353,3 +30353,70 @@ (define-public i3-autotiling "Script for Sway and i3 to automatically switch the horizontal/vertical window split orientation.") (license license:gpl3))) + +;; linode-cli would normally fetch this at build time +;; TODO: is there a way to refer to previous versions? is there even a point +;; in trying to? +(define linode-openapi-spec + (origin + (method url-fetch) + (uri "https://www.linode.com/docs/api/openapi.yaml") + (sha256 + (base32 + "1jcjfnagjihcy03fcmn5sghdf7a80798xjgj1x7z3ncqwd5aggwg")))) + +(define-public linode-cli + (package + (name "linode-cli") + (version "5.22.0") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/linode/linode-cli") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1fv53wikx745kci86xrsq9kfsgv0a65srhywdw32cab1wywwpn2z")))) + (build-system python-build-system) + (arguments (list + #:tests? #f ;; requires personal access token + #:phases + #~(modify-phases %standard-phases + (add-after 'build 'bake-api + (lambda _ + ;; The "build" make target tries to do some Python 2 + ;; stuff, so instead we just take the two lines we care + ;; about: + (invoke "python3" "-m" "linodecli" "bake" + #+linode-openapi-spec + "--skip-config") + (copy-file "data-3" "linodecli/data-3"))) + (add-before 'install 'fix-bash-completions-path + (lambda _ + ;; rename it so setup.py thinks it's missing and + ;; doesn't try to install it to /etc + (rename-file "linode-cli.sh" "completions") + ;; TODO for some reason these don't work? + ;; I don't use bash, so I leave it for someone else to + ;; figure out. + (install-file + "completions" + (string-append #$output "/share/bash-completion/")))) + (replace 'sanity-check + (lambda _ + ;; this way it doesn't ask for an access token + (invoke "linode-cli" "--version" "--skip-config")))))) + (inputs + (list + python-terminaltables + python-requests + python-pyyaml)) + (synopsis "Tool for managing Linode resources") + (home-page "https://www.linode.com/docs/products/tools/cli/") + (description + "A wrapper around the Linode API, which gives you the ability to manage +your Linode account from the command line. Almost any task that can be done +through the Cloud Manager can also be performed through the CLI.") + (license license:bsd-3))) -- 2.37.1