nixpkgs-suyu/pkgs/development/python-modules/pyp/default.nix
2023-05-15 00:45:00 +02:00

56 lines
972 B
Nix

{ lib
, buildPythonPackage
, fetchFromGitHub
, pytestCheckHook
, coreutils
, pythonOlder
, astunparse
, flit-core
, jq
, bc
}:
buildPythonPackage rec {
pname = "pyp";
version = "1.1.0";
format = "pyproject";
disabled = pythonOlder "3.6";
src = fetchFromGitHub {
owner = "hauntsaninja";
repo = pname;
rev = "refs/tags/v${version}";
hash = "sha256-A1Ip41kxH17BakHEWEuymfa24eBEl5FIHAWL+iZFM4I=";
};
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 ];
};
}