about summary refs log tree commit diff
path: root/pkgs/by-name/gi/git-pw/package.nix
blob: 6dbcc369e37098da729cd3102ec4cf34a5a7601a (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
52
53
54
55
56
57
58
59
{ lib
, git
, python3
, fetchFromGitHub
, testers
, git-pw
}:

python3.pkgs.buildPythonApplication rec {
  pname = "git-pw";
  version = "2.6.0";
  format = "pyproject";

  PBR_VERSION = version;

  src = fetchFromGitHub {
    owner = "getpatchwork";
    repo = "git-pw";
    rev = version;
    hash = "sha256-3IiFU6qGI2MDTBOLQ2qyT5keUMNTNG3sxhtGR3bkIBc=";
  };

  postPatch = ''
    # We don't want to run the coverage.
    substituteInPlace tox.ini --replace "--cov=git_pw --cov-report" ""
  '';

  nativeBuildInputs = with python3.pkgs; [
    pbr
    setuptools
  ];

  propagatedBuildInputs = with python3.pkgs; [
    pyyaml
    arrow
    click
    requests
    tabulate
  ];

  nativeCheckInputs = with python3.pkgs; [
    pytest
    git
  ];

  # This is needed because `git-pw` always rely on an ambiant git.
  # Furthermore, this doesn't really make sense to resholve git inside this derivation.
  # As `testVersion` does not offer the right knob, we can just `overrideAttrs`-it ourselves.
  passthru.tests.version = (testers.testVersion { package = git-pw; }).overrideAttrs (old: {
    buildInputs = (old.buildInputs or [ ]) ++ [ git ];
  });

  meta = with lib; {
    description = "A tool for integrating Git with Patchwork, the web-based patch tracking system";
    homepage = "https://github.com/getpatchwork/git-pw";
    license = licenses.mit;
    maintainers = with maintainers; [ raitobezarius ];
  };
}