1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pytestCheckHook
5, coreutils
6, pythonOlder
7, astunparse
8, flit-core
9, jq
10, bc
11}:
12
13buildPythonPackage rec {
14 pname = "pyp";
15 version = "1.1.0";
16 format = "pyproject";
17
18 disabled = pythonOlder "3.6";
19
20 src = fetchFromGitHub {
21 owner = "hauntsaninja";
22 repo = pname;
23 rev = "refs/tags/v${version}";
24 hash = "sha256-A1Ip41kxH17BakHEWEuymfa24eBEl5FIHAWL+iZFM4I=";
25 };
26
27 nativeBuildInputs = [
28 flit-core
29 ];
30
31 propagatedBuildInputs = lib.optionals (pythonOlder "3.9") [
32 astunparse
33 ];
34
35 preCheck = ''
36 export PATH=$out/bin:$PATH
37 '';
38
39 nativeCheckInputs = [
40 pytestCheckHook
41 coreutils
42 jq
43 bc
44 ];
45
46 pythonImportsCheck = [
47 "pyp"
48 ];
49
50 meta = with lib; {
51 description = "Easily run Python at the shell! Magical, but never mysterious";
52 homepage = "https://github.com/hauntsaninja/pyp";
53 license = licenses.mit;
54 maintainers = with maintainers; [ rmcgibbo ];
55 };
56}