Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / applications / misc / mozphab / default.nix
blob28f1e4b2d98cf71e60eee94981842a04de8612f3
1 { lib
2 , fetchFromGitHub
3 , python3
5 # tests
6 , git
7 , mercurial
8 , patch
9 }:
11 python3.pkgs.buildPythonApplication rec {
12   pname = "mozphab";
13   version = "1.4.3";
14   format = "pyproject";
16   src = fetchFromGitHub {
17     owner = "mozilla-conduit";
18     repo = "review";
19     rev = "refs/tags/${version}";
20     hash = "sha256-FUHT4MPzSxO3MCNYWodNxvFR2kL0P4eGmSHPtCt0Cug=";
21   };
23   postPatch = ''
24     substituteInPlace pyproject.toml \
25       --replace "glean-sdk>=50.0.1,==50.*" "glean-sdk"
26   '';
28   nativeBuildInputs = with python3.pkgs; [
29     setuptools
30     setuptools-scm
31   ];
33   env.SETUPTOOLS_SCM_PRETEND_VERSION = version;
35   propagatedBuildInputs = with python3.pkgs; [
36     colorama
37     distro
38     glean-sdk
39     packaging
40     python-hglib
41     sentry-sdk
42     setuptools
43   ];
45   nativeCheckInputs = [
46     git
47     mercurial
48     patch
49   ]
50   ++ (with python3.pkgs; [
51     callee
52     immutabledict
53     hg-evolve
54     mock
55     pytestCheckHook
56   ]);
58   preCheck = ''
59     export HOME=$(mktemp -d)
60   '';
62   disabledTestPaths = [
63     # codestyle doesn't matter to us
64     "tests/test_style.py"
65     # integration tests try to submit changes, which requires network access
66     "tests/test_integration_git.py"
67     "tests/test_integration_hg.py"
68     "tests/test_integration_hg_dag.py"
69     "tests/test_integration_patch.py"
70     "tests/test_integration_reorganise.py"
71     "tests/test_sentry.py"
72   ];
74   meta = with lib; {
75     description = "Phabricator CLI from Mozilla to support submission of a series of commits";
76     longDescription = ''
77       moz-phab is a custom command-line tool, which communicates to
78       Phabricator’s API, providing several conveniences, including support for
79       submitting series of commits.
80     '';
81     homepage = "https://moz-conduit.readthedocs.io/en/latest/phabricator-user.html";
82     license = licenses.mpl20;
83     maintainers = with maintainers; [];
84     platforms = platforms.unix;
85   };