1{
2 lib,
3 fetchFromGitHub,
4 python3,
5
6 # tests
7 git,
8 mercurial,
9 patch,
10}:
11
12python3.pkgs.buildPythonApplication rec {
13 pname = "mozphab";
14 version = "1.9.0";
15 pyproject = true;
16
17 src = fetchFromGitHub {
18 owner = "mozilla-conduit";
19 repo = "review";
20 tag = version;
21 hash = "sha256-CVpsq9YoEww47uruHYEsJk9YQ39ZFQsMdL0nBc8AHUM=";
22 };
23
24 build-system = with python3.pkgs; [
25 setuptools
26 setuptools-scm
27 ];
28
29 pythonRelaxDeps = [ "glean-sdk" ];
30
31 dependencies = with python3.pkgs; [
32 colorama
33 distro
34 glean-sdk
35 packaging
36 python-hglib
37 sentry-sdk
38 setuptools
39 ];
40
41 nativeCheckInputs = [
42 git
43 mercurial
44 patch
45 ]
46 ++ (with python3.pkgs; [
47 callee
48 immutabledict
49 hg-evolve
50 mock
51 pytestCheckHook
52 ]);
53
54 preCheck = ''
55 export HOME=$(mktemp -d)
56 '';
57
58 disabledTests = [
59 # AttributeError: 'called_once' is not a valid assertion.
60 "test_commit"
61 # AttributeError: 'not_called' is not a valid assertion.
62 "test_finalize_no_evolve"
63 "test_patch"
64 ];
65
66 disabledTestPaths = [
67 # codestyle doesn't matter to us
68 "tests/test_style.py"
69 # integration tests try to submit changes, which requires network access
70 "tests/test_integration_git.py"
71 "tests/test_integration_hg.py"
72 "tests/test_integration_hg_dag.py"
73 "tests/test_integration_patch.py"
74 "tests/test_integration_reorganise.py"
75 "tests/test_sentry.py"
76 ];
77
78 meta = with lib; {
79 description = "Phabricator CLI from Mozilla to support submission of a series of commits";
80 mainProgram = "moz-phab";
81 longDescription = ''
82 moz-phab is a custom command-line tool, which communicates to
83 Phabricator’s API, providing several conveniences, including support for
84 submitting series of commits.
85 '';
86 homepage = "https://moz-conduit.readthedocs.io/en/latest/phabricator-user.html";
87 license = licenses.mpl20;
88 maintainers = [ ];
89 platforms = platforms.unix;
90 };
91}