Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linode-cli: remove deprecated perl version, init python version at 2.14.1 #85238

Merged
merged 1 commit into from Apr 15, 2020

Conversation

ryantm
Copy link
Member

@ryantm ryantm commented Apr 14, 2020

Motivation for this change

This is the new official CLI for accessing the Linode APIs.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Copy link
Contributor

@jonringer jonringer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we may want to replace the deprecated linode-cli package:
pkgs/tools/virtualization/linode-cli/default.nix

Copy link
Contributor

@jonringer jonringer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, they unfortunately mispackaged this as well for python3:

  ERROR: Could not find a version that satisfies the requirement enum34 (from linode-cli==2.14.1) (from versions: none)
  ERROR: No matching distribution found for enum34 (from linode-cli==2.14.1)

their METADATA:

Requires-Python: >=2.7
Requires-Dist: PyYAML
Requires-Dist: colorclass
Requires-Dist: enum34

enum34 should only be required if python<3.4

, setuptools
}:

buildPythonApplication rec {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

buildPythonApplication shouldn't be used in python-modules, this should probably be moved to pkgs/tools/virtualization/linode-cli/default.nix, the top-level attr should be move to all-packages, and should look like:

  linode-cli = python3Packages.callPackage ../tools/virtualization/linode-cli/default.nix { };

@jonringer
Copy link
Contributor

jonringer commented Apr 14, 2020

Here's what I came up with:

{ lib
, buildPythonApplication
, fetchFromGitHub
, fetchpatch
, isPy27
, terminaltables
, colorclass
, requests
, pyyaml
, enum34
, setuptools
}:

buildPythonApplication rec {
  pname = "linode-cli";
  version = "2.14.1";

  src = fetchFromGitHub {
    owner = "linode";
    repo = pname;
    rev = version;
    sha256 = "1hpdmbzs182iag471yvq3kwd1san04a58sczzbmw6vjv2kswn1c2";
  };

  patches = [
    # make enum34 depend on python version
    ( fetchpatch {
        url = "https://github.com/linode/linode-cli/pull/184/commits/4cf55759c5da33fbc49b9ba664698875d67d4f76.patch";
        sha256 = "04n9a6yh0abyyymvfzajhav6qxwvzjl2vs8jnqp3yqrma7kl0slj";
    })
  ];

  # remove need for git history
  prePatch = ''
    substituteInPlace setup.py \
      --replace "version=get_version()," "version='${version}',"
  '';

  propagatedBuildInputs = [
    terminaltables
    colorclass
    requests
    pyyaml
    setuptools
  ] ++ lib.optionals isPy27 [ enum34 ];

  # 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 ];
  };

}

@jonringer
Copy link
Contributor

I made a PR correcting the enum34 logic linode/linode-cli#184 , and included it here as a patch

@ryantm
Copy link
Member Author

ryantm commented Apr 14, 2020

we may want to replace the deprecated linode-cli package:
pkgs/tools/virtualization/linode-cli/default.nix

cc @nixy maintainer of Perl linode-cli

@nixy
Copy link
Contributor

nixy commented Apr 14, 2020

we may want to replace the deprecated linode-cli package:
pkgs/tools/virtualization/linode-cli/default.nix

cc @nixy maintainer of Perl linode-cli

Seems fine to me, no objections here.

@ofborg ofborg bot removed the 6.topic: python label Apr 14, 2020
@ryantm ryantm changed the title pythonPackages.linode-cli: init at 2.14.1 linode-cli: remove deprecated perl version, init python version at 2.14.1 Apr 15, 2020
@ryantm ryantm force-pushed the linode-cli branch 2 times, most recently from bd00093 to 1956eef Compare April 15, 2020 00:09
@ryantm ryantm requested a review from jonringer April 15, 2020 00:09
@ryantm ryantm merged commit 5b36111 into NixOS:master Apr 15, 2020
@ryantm ryantm deleted the linode-cli branch April 15, 2020 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants