about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/misc/mozphab/default.nix
blob: 6d8455e6915d95fe6b5d3d2f61b644cb51e77ec2 (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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
{ lib
, fetchFromGitHub
, python3

# tests
, git
, mercurial
, patch
}:

python3.pkgs.buildPythonApplication rec {
  pname = "mozphab";
  version = "1.5.1";
  format = "pyproject";

  src = fetchFromGitHub {
    owner = "mozilla-conduit";
    repo = "review";
    rev = "refs/tags/${version}";
    hash = "sha256-HxwQ+mGtjnruppPAD01QUg3aca+k5vpj814BWM+3VfQ=";
  };

  postPatch = ''
    substituteInPlace pyproject.toml \
      --replace "glean-sdk>=50.0.1,==50.*" "glean-sdk"
  '';

  nativeBuildInputs = with python3.pkgs; [
    setuptools
    setuptools-scm
  ];

  propagatedBuildInputs = with python3.pkgs; [
    colorama
    distro
    glean-sdk
    packaging
    python-hglib
    sentry-sdk
    setuptools
  ];

  nativeCheckInputs = [
    git
    mercurial
    patch
  ]
  ++ (with python3.pkgs; [
    callee
    immutabledict
    hg-evolve
    mock
    pytestCheckHook
  ]);

  preCheck = ''
    export HOME=$(mktemp -d)
  '';

  disabledTestPaths = [
    # codestyle doesn't matter to us
    "tests/test_style.py"
    # integration tests try to submit changes, which requires network access
    "tests/test_integration_git.py"
    "tests/test_integration_hg.py"
    "tests/test_integration_hg_dag.py"
    "tests/test_integration_patch.py"
    "tests/test_integration_reorganise.py"
    "tests/test_sentry.py"
  ];

  meta = with lib; {
    description = "Phabricator CLI from Mozilla to support submission of a series of commits";
    longDescription = ''
      moz-phab is a custom command-line tool, which communicates to
      Phabricator’s API, providing several conveniences, including support for
      submitting series of commits.
    '';
    homepage = "https://moz-conduit.readthedocs.io/en/latest/phabricator-user.html";
    license = licenses.mpl20;
    maintainers = with maintainers; [];
    platforms = platforms.unix;
  };
}