about summary refs log tree commit diff
path: root/nixpkgs/pkgs/by-name/py/pyp/package.nix
blob: 1ba4629220db671c9dcf2c7595f09e6a96265578 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{ lib
, fetchFromGitHub
, python3
, bc
, jq
}:

let
  version = "1.1.0";
in python3.pkgs.buildPythonApplication {
  pname = "pyp";
  inherit version;
  format = "pyproject";

  src = fetchFromGitHub {
    owner = "hauntsaninja";
    repo = "pyp";
    rev = "v${version}";
    hash = "sha256-A1Ip41kxH17BakHEWEuymfa24eBEl5FIHAWL+iZFM4I=";
  };

  nativeBuildInputs = [
    python3.pkgs.flit-core
  ];

  nativeCheckInputs = [
    python3.pkgs.pytestCheckHook
    bc
    jq
  ];

  # 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";
    changelog = "https://github.com/hauntsaninja/pyp/blob/${version}/CHANGELOG.md";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ AndersonTorres ];
  };
}