diff --git a/pkgs/by-name/py/pyp/package.nix b/pkgs/by-name/py/pyp/package.nix index aea53b2c2b05..74fdc2f64af2 100644 --- a/pkgs/by-name/py/pyp/package.nix +++ b/pkgs/by-name/py/pyp/package.nix @@ -1,13 +1,16 @@ { 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