2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
2022-04-27 09:35:20 +00:00
|
|
|
, brotli
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
2020-09-25 04:45:31 +00:00
|
|
|
, fetchFromGitHub
|
2022-04-27 09:35:20 +00:00
|
|
|
, fetchpatch
|
2020-09-25 04:45:31 +00:00
|
|
|
, httpretty
|
2022-04-27 09:35:20 +00:00
|
|
|
, ijson
|
|
|
|
, poetry-core
|
2022-05-18 14:49:53 +00:00
|
|
|
, python-magic
|
2020-04-24 23:36:52 +00:00
|
|
|
, pytz
|
2022-04-27 09:35:20 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
, requests-oauthlib
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pysnow";
|
2020-06-02 18:00:15 +00:00
|
|
|
version = "0.7.16";
|
2022-04-27 09:35:20 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "rbw";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2022-04-27 09:35:20 +00:00
|
|
|
hash = "sha256-nKOPCkS2b3ObmBnk/7FTv4o4vwUX+tOtZI5OQQ4HSTY=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2020-09-25 04:45:31 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
poetry-core
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
brotli
|
2020-09-25 04:45:31 +00:00
|
|
|
ijson
|
2022-05-18 14:49:53 +00:00
|
|
|
python-magic
|
2020-09-25 04:45:31 +00:00
|
|
|
pytz
|
2022-04-27 09:35:20 +00:00
|
|
|
requests-oauthlib
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
httpretty
|
|
|
|
pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
patches = [
|
|
|
|
# Switch to peotry-core, https://github.com/rbw/pysnow/pull/183
|
|
|
|
(fetchpatch {
|
|
|
|
name = "switch-to-poetry-core.patch";
|
|
|
|
url = "https://github.com/rbw/pysnow/commit/f214a203432b329df5317f3a25b2c0d9b55a9029.patch";
|
|
|
|
sha256 = "sha256-ViRR+9WStlaQwyrLGk/tMOUAcEMY+kB61ZEKGMQJ30o=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace 'ijson = "^2.5.1"' 'ijson = "*"' \
|
|
|
|
--replace 'pytz = "^2019.3"' 'pytz = "*"' \
|
|
|
|
--replace 'oauthlib = "^3.1.0"' 'oauthlib = "*"'
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
2022-04-27 09:35:20 +00:00
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"pysnow"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "ServiceNow HTTP client library written in Python";
|
|
|
|
homepage = "https://github.com/rbw/pysnow";
|
|
|
|
license = licenses.mit;
|
2022-04-27 09:35:20 +00:00
|
|
|
maintainers = with maintainers; [ almac ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|