push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,96 @@
{
stdenv,
buildPythonApplication,
colorclass,
fetchPypi,
fetchurl,
installShellFiles,
lib,
linode-metadata,
openapi3,
packaging,
pyyaml,
requests,
rich,
setuptools,
terminaltables,
}:
let
hash = "sha256-QQxadKVEIh1PvD8FdYgJ/U1iyWdy6FvO+LUELQ70KKw=";
# specVersion taken from: https://www.linode.com/docs/api/openapi.yaml at `info.version`.
specVersion = "4.176.0";
specHash = "sha256-P1E8Ga5ckrsw/CX0kxFef5fe8/p/pDCLuleX9wR5l48=";
spec = fetchurl {
url = "https://raw.githubusercontent.com/linode/linode-api-docs/v${specVersion}/openapi.yaml";
hash = specHash;
};
in
buildPythonApplication rec {
pname = "linode-cli";
version = "5.56.2";
pyproject = true;
src = fetchPypi {
pname = "linode_cli";
inherit version;
hash = hash;
};
patches = [ ./remove-update-check.patch ];
# remove need for git history
prePatch = ''
substituteInPlace setup.py \
--replace "version = get_version()" "version='${version}',"
'';
postConfigure = ''
python3 -m linodecli bake ${spec} --skip-config
cp data-3 linodecli/
echo "${version}" > baked_version
'';
nativeBuildInputs = [ installShellFiles ];
propagatedBuildInputs = [
colorclass
linode-metadata
pyyaml
requests
setuptools
terminaltables
rich
openapi3
packaging
];
doInstallCheck = true;
installCheckPhase = ''
$out/bin/linode-cli --skip-config --version | grep ${version} > /dev/null
'';
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
for shell in bash fish; do
installShellCompletion --cmd linode-cli \
--$shell <($out/bin/linode-cli --skip-config completion $shell)
done
'';
passthru.updateScript = ./update.sh;
meta = {
description = "Linode Command Line Interface";
changelog = "https://github.com/linode/linode-cli/releases/tag/v${version}";
downloadPage = "https://pypi.org/project/linode-cli";
homepage = "https://github.com/linode/linode-cli";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [
ryantm
techknowlogick
];
mainProgram = "linode-cli";
};
}

View File

@@ -0,0 +1,13 @@
diff --git a/linodecli/api_request.py b/linodecli/api_request.py
index 4273aa6..3ada5c2 100644
--- a/linodecli/api_request.py
+++ b/linodecli/api_request.py
@@ -305,7 +305,7 @@ def _attempt_warn_old_version(ctx, result):
file=sys.stderr,
)
- if api_version_higher:
+ if False:
# check to see if there is, in fact, a version to upgrade to. If not, don't
# suggest an upgrade (since there's no package anyway)
new_version_exists = False

View File

@@ -0,0 +1,30 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl gnugrep gnused jq yq-go
set -x -eu -o pipefail
cd $(dirname "${BASH_SOURCE[0]}")
SPEC_VERSION=$(curl -s https://www.linode.com/docs/api/openapi.yaml | yq eval '.info.version' -)
SPEC_SHA256=$(nix-prefetch-url --quiet https://raw.githubusercontent.com/linode/linode-api-docs/v${SPEC_VERSION}/openapi.yaml)
VERSION=$(curl -s ${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} \
-H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/linode/linode-cli/tags" \
| jq 'map(.name)' \
| grep '"' \
| sed 's/[ ",(^v)]//g' \
| grep -v -e rc -e list \
| cut -d '"' -f4 | sort -rV | head -n 1)
SHA256=$(nix-prefetch-url --quiet --unpack https://github.com/linode/linode-cli/archive/refs/tags/v${VERSION}.tar.gz)
setKV () {
sed -i "s|$1 = \".*\"|$1 = \"${2:-}\"|" ./default.nix
}
setKV specVersion ${SPEC_VERSION}
setKV specHash ${SPEC_SHA256}
setKV version ${VERSION}
setKV hash ${SHA256}