Unverified Commit 716331fb authored by superherointj's avatar superherointj Committed by GitHub
Browse files

Merge pull request #327408 from superherointj/linode-cli-4.176.0

linode-cli: 4.166.0 -> 4.176.0
parents 91c1f02d 050f873c
Loading
Loading
Loading
Loading
+44 −0
Original line number Diff line number Diff line
{
  buildPythonPackage,
  fetchPypi,
  httpx,
  lib,
  linode-cli,
  pytest,
  pytest-asyncio,
  setuptools,
}:

buildPythonPackage rec {
  pname = "linode-metadata";
  version = "0.3.0";

  src = fetchPypi {
    pname = "linode_metadata";
    inherit version;
    hash = "sha256-ZFCv9f4hbiBaJuKvzs/BGFoP+mAFwVa8OFF22b22voI=";
  };

  pyproject = true;

  dependencies = [
    httpx
    setuptools
  ];

  checkInputs = [
    pytest
    pytest-asyncio
  ];

  pythonImportsCheck = [ "linode_metadata" ];

  meta = {
    description = "Python package for interacting with the Linode Metadata Service";
    downloadPage = "https://pypi.org/project/linode-metadata/";
    homepage = "https://github.com/linode/py-metadata";
    changelog = "https://github.com/linode/py-metadata/releases/tag/v${version}";
    license = lib.licenses.bsd3;
    maintainers = linode-cli.meta.maintainers;
  };
}
+46 −37
Original line number Diff line number Diff line
{ lib
, fetchFromGitHub
, fetchurl
, buildPythonApplication
, colorclass
, installShellFiles
, pyyaml
, requests
, setuptools
, terminaltables
, rich
, openapi3
, packaging
{
  buildPythonApplication,
  colorclass,
  fetchPypi,
  fetchurl,
  installShellFiles,
  lib,
  linode-metadata,
  openapi3,
  packaging,
  pyyaml,
  requests,
  rich,
  setuptools,
  terminaltables,
}:

let
  hash = "sha256-J0L+FTVzYuAqTDOwpoH12lQr03UNo5dsQpd/iUKR40Q=";
  hash = "sha256-IXltDBgabTBDw0y7IXgRGpAWVUyqeJI8EfxkZ5YuQrU=";
  # specVersion taken from: https://www.linode.com/docs/api/openapi.yaml at `info.version`.
  specVersion = "4.166.0";
  specHash = "sha256-rUwKQt3y/ALZUoW3eJiiIDJYLQpUHO7Abm0h09ra02g=";
  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;
@@ -27,19 +29,16 @@ in

buildPythonApplication rec {
  pname = "linode-cli";
  version = "5.45.0";
  version = "5.50.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "linode";
    repo = pname;
    rev = "v${version}";
    inherit hash;
  src = fetchPypi {
    pname = "linode_cli";
    inherit version;
    hash = "sha256-OCnO7Bf2tDnC4g7kYS0WFlV9plAS25GbzRO6mpDYYxk=";
  };

  patches = [
    ./remove-update-check.patch
  ];
  patches = [ ./remove-update-check.patch ];

  # remove need for git history
  prePatch = ''
@@ -47,8 +46,17 @@ buildPythonApplication rec {
      --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
@@ -58,29 +66,30 @@ buildPythonApplication rec {
    packaging
  ];

  postConfigure = ''
    python3 -m linodecli bake ${spec} --skip-config
    cp data-3 linodecli/
    echo "${version}" > baked_version
  '';

  doInstallCheck = true;
  installCheckPhase = ''
    $out/bin/linode-cli --skip-config --version | grep ${version} > /dev/null
  '';

  nativeBuildInputs = [ installShellFiles ];
  postInstall = ''
    installShellCompletion --cmd linode-cli --bash <($out/bin/linode-cli --skip-config completion bash)
    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 = with lib; {
    mainProgram = "linode-cli";
  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 = licenses.bsd3;
    maintainers = with maintainers; [ ryantm techknowlogick ];
    license = lib.licenses.bsd3;
    maintainers = with lib.maintainers; [
      ryantm
      techknowlogick
    ];
    mainProgram = "linode-cli";
  };
}
+2 −0
Original line number Diff line number Diff line
@@ -6996,6 +6996,8 @@ self: super: with self; {
  linode-api = callPackage ../development/python-modules/linode-api { };
  linode-metadata = callPackage ../development/python-modules/linode-metadata { };
  linode = callPackage ../development/python-modules/linode { };
  linuxfd = callPackage ../development/python-modules/linuxfd { };