From 3529e5eed27e75d776d0a83f2415a486a1fc3b9c Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Tue, 17 Jun 2025 18:37:00 +0200 Subject: [PATCH] pyp: cleanup --- pkgs/by-name/py/pyp/package.nix | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) 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