Unverified Commit c188c9b0 authored by Florian Klink's avatar Florian Klink Committed by GitHub
Browse files

pyp: cleanup (#417604)

parents 0dc5802b 3529e5ee
Loading
Loading
Loading
Loading
+12 −18
Original line number Diff line number Diff line
{
  lib,
  bc,
  python3Packages,
  fetchFromGitHub,

  # tests
  addBinToPathHook,
  bc,
  jq,
  python3,
  versionCheckHook,
}:

let
  pythonPackages = python3.pkgs;
  finalAttrs = {
    pname = "pyp";
    version = "1.3.0";
@@ -21,35 +24,26 @@ let

    pyproject = true;

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

    nativeCheckInputs =
      (with pythonPackages; [
      (with python3Packages; [
        pytestCheckHook
      ])
      ++ [
        addBinToPathHook
        bc
        jq
        versionCheckHook
      ];
    versionCheckProgramArg = "--version";

    pythonImportsCheck = [
      "pyp"
    ];

    # without this, the tests fail because they are unable to find the pyp tool
    # itself...
    preCheck = ''
      _OLD_PATH_=$PATH
      PATH=$out/bin:$PATH
    '';

    # And a cleanup!
    postCheck = ''
      PATH=$_OLD_PATH_
    '';

    meta = {
      homepage = "https://github.com/hauntsaninja/pyp";
      description = "Easily run Python at the shell";
@@ -62,4 +56,4 @@ let
    };
  };
in
pythonPackages.buildPythonPackage finalAttrs
python3Packages.buildPythonPackage finalAttrs