Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / python-modules / pysnow / default.nix
blob52613d602d828f7f9c773fec13415179dc6812c4
1 { lib
2 , brotli
3 , buildPythonPackage
4 , fetchFromGitHub
5 , fetchpatch
6 , httpretty
7 , ijson
8 , poetry-core
9 , python-magic
10 , pytz
11 , pytestCheckHook
12 , requests-oauthlib
15 buildPythonPackage rec {
16   pname = "pysnow";
17   version = "0.7.16";
18   format = "pyproject";
21   src = fetchFromGitHub {
22     owner = "rbw";
23     repo = pname;
24     rev = version;
25     hash = "sha256-nKOPCkS2b3ObmBnk/7FTv4o4vwUX+tOtZI5OQQ4HSTY=";
26   };
28   nativeBuildInputs = [
29     poetry-core
30   ];
32   propagatedBuildInputs = [
33     brotli
34     ijson
35     python-magic
36     pytz
37     requests-oauthlib
38   ];
40   nativeCheckInputs = [
41     httpretty
42     pytestCheckHook
43   ];
45   patches = [
46     # Switch to peotry-core, https://github.com/rbw/pysnow/pull/183
47     (fetchpatch {
48       name = "switch-to-poetry-core.patch";
49       url = "https://github.com/rbw/pysnow/commit/f214a203432b329df5317f3a25b2c0d9b55a9029.patch";
50       hash = "sha256-ViRR+9WStlaQwyrLGk/tMOUAcEMY+kB61ZEKGMQJ30o=";
51     })
52   ];
54   postPatch = ''
55     substituteInPlace pyproject.toml \
56       --replace 'ijson = "^2.5.1"' 'ijson = "*"' \
57       --replace 'pytz = "^2019.3"' 'pytz = "*"' \
58       --replace 'oauthlib = "^3.1.0"' 'oauthlib = "*"'
59   '';
61   pythonImportsCheck = [
62     "pysnow"
63   ];
65   meta = with lib; {
66     description = "ServiceNow HTTP client library written in Python";
67     homepage = "https://github.com/rbw/pysnow";
68     license = licenses.mit;
69     maintainers = with maintainers; [ almac ];
70   };