Unverified Commit ea2e6eba authored by Fabián Heredia Montiel's avatar Fabián Heredia Montiel Committed by GitHub
Browse files

Merge pull request #292693 from atorres1985-contrib/pyp

pyp: 1.1.0 -> 1.2.0
parents 6a534117 cd975261
Loading
Loading
Loading
Loading
+52 −43
Original line number Diff line number Diff line
{ lib
, fetchFromGitHub
, python3
, bc
, fetchFromGitHub
, jq
, python3
}:

let
  version = "1.1.0";
in python3.pkgs.buildPythonApplication {
  pythonPackages = python3.pkgs;
  finalAttrs = {
    pname = "pyp";
  inherit version;
  format = "pyproject";
    version = "1.2.0";

    src = fetchFromGitHub {
      owner = "hauntsaninja";
      repo = "pyp";
    rev = "v${version}";
    hash = "sha256-A1Ip41kxH17BakHEWEuymfa24eBEl5FIHAWL+iZFM4I=";
      rev = "refs/tags/v${finalAttrs.version}";
      hash = "sha256-hnEgqWOIVj2ugOhd2aS9IulfkVnrlkhwOtrgH4qQqO8=";
    };

  nativeBuildInputs = [
    python3.pkgs.flit-core
    pyproject = true;

    build-system = with pythonPackages; [
      flit-core
    ];

  nativeCheckInputs = [
    python3.pkgs.pytestCheckHook
    nativeCheckInputs = (with pythonPackages; [
      pytestCheckHook
    ]) ++ [
      bc
      jq
    ];

    pythonImportsCheck = [
      "pyp"
    ];

    # without this, the tests fail because they are unable to find the pyp tool
    # itself...
    preCheck = ''
@@ -36,7 +42,7 @@ in python3.pkgs.buildPythonApplication {
      PATH=$out/bin:$PATH
   '';

  # And a cleanup
    # And a cleanup!
    postCheck = ''
      PATH=$_OLD_PATH_
    '';
@@ -44,8 +50,11 @@ in python3.pkgs.buildPythonApplication {
    meta = {
      homepage = "https://github.com/hauntsaninja/pyp";
      description = "Easily run Python at the shell";
    changelog = "https://github.com/hauntsaninja/pyp/blob/${version}/CHANGELOG.md";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ AndersonTorres ];
      changelog = "https://github.com/hauntsaninja/pyp/blob/${finalAttrs.version}/CHANGELOG.md";
      license = with lib.licenses; [ mit ];
      mainProgram = "pyp";
      maintainers = with lib.maintainers; [ rmcgibbo AndersonTorres ];
    };
  };
}
in
pythonPackages.buildPythonPackage finalAttrs
+0 −56
Original line number Diff line number Diff line
{ lib
, buildPythonPackage
, fetchFromGitHub
, pytestCheckHook
, coreutils
, pythonOlder
, astunparse
, flit-core
, jq
, bc
}:

buildPythonPackage rec {
  pname = "pyp";
  version = "1.2.0";
  format = "pyproject";

  disabled = pythonOlder "3.6";

  src = fetchFromGitHub {
    owner = "hauntsaninja";
    repo = pname;
    rev = "refs/tags/v${version}";
    hash = "sha256-hnEgqWOIVj2ugOhd2aS9IulfkVnrlkhwOtrgH4qQqO8=";
  };

  nativeBuildInputs = [
    flit-core
  ];

  propagatedBuildInputs = lib.optionals (pythonOlder "3.9") [
    astunparse
  ];

  preCheck = ''
    export PATH=$out/bin:$PATH
  '';

  nativeCheckInputs = [
    pytestCheckHook
    coreutils
    jq
    bc
  ];

  pythonImportsCheck = [
    "pyp"
  ];

  meta = with lib; {
    description = "Easily run Python at the shell! Magical, but never mysterious";
    homepage = "https://github.com/hauntsaninja/pyp";
    license = licenses.mit;
    maintainers = with maintainers; [ rmcgibbo ];
   };
}
+0 −4
Original line number Diff line number Diff line
@@ -11173,10 +11173,6 @@ self: super: with self; {
  pyomo = callPackage ../development/python-modules/pyomo { };
  pyp = callPackage ../development/python-modules/pyp {
    inherit (pkgs) jq;
  };
  pypng = callPackage ../development/python-modules/pypng { };
  phonemizer = callPackage ../development/python-modules/phonemizer { };