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