2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
2020-09-25 04:45:31 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, poetry
|
2020-04-24 23:36:52 +00:00
|
|
|
, brotli
|
|
|
|
, ijson
|
|
|
|
, nose
|
2020-09-25 04:45:31 +00:00
|
|
|
, httpretty
|
|
|
|
, requests_oauthlib
|
2020-04-24 23:36:52 +00:00
|
|
|
, python_magic
|
|
|
|
, pytz
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pysnow";
|
2020-06-02 18:00:15 +00:00
|
|
|
version = "0.7.16";
|
2020-09-25 04:45:31 +00:00
|
|
|
|
|
|
|
# tests not included in pypi tarball
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "rbw";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
|
|
|
sha256 = "0dj90w742klfcjnx7yhp0nzki2mzafqzzr0rk2dp6vxn8h58z8ww";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2020-09-25 04:45:31 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
|
|
|
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
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
nativeBuildInputs = [ poetry ];
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
brotli
|
2020-09-25 04:45:31 +00:00
|
|
|
ijson
|
|
|
|
python_magic
|
|
|
|
pytz
|
2020-04-24 23:36:52 +00:00
|
|
|
requests_oauthlib
|
|
|
|
];
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
checkInputs = [ nose httpretty ];
|
2020-04-24 23:36:52 +00:00
|
|
|
checkPhase = ''
|
|
|
|
nosetests --cover-package=pysnow --with-coverage --cover-erase
|
|
|
|
'';
|
2020-09-25 04:45:31 +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;
|
2020-09-25 04:45:31 +00:00
|
|
|
maintainers = [ maintainers.almac ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|