2020-02-10 22:10:01 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
2020-09-10 23:00:52 +01:00
|
|
|
, fetchFromGitHub
|
|
|
|
, poetry
|
2020-02-10 22:10:01 +00:00
|
|
|
, brotli
|
|
|
|
, ijson
|
|
|
|
, nose
|
2020-09-10 23:00:52 +01:00
|
|
|
, httpretty
|
2020-08-25 03:07:09 +01:00
|
|
|
, requests_oauthlib
|
2020-02-10 22:10:01 +00:00
|
|
|
, python_magic
|
|
|
|
, pytz
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pysnow";
|
2020-05-09 11:01:56 +01:00
|
|
|
version = "0.7.16";
|
2020-08-25 03:07:09 +01:00
|
|
|
|
2020-09-10 23:00:52 +01:00
|
|
|
# tests not included in pypi tarball
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "rbw";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
|
|
|
sha256 = "0dj90w742klfcjnx7yhp0nzki2mzafqzzr0rk2dp6vxn8h58z8ww";
|
2020-02-10 22:10:01 +00:00
|
|
|
};
|
2020-09-10 23:00:52 +01:00
|
|
|
format = "pyproject";
|
2020-02-10 22:10:01 +00:00
|
|
|
|
2020-09-10 23:00:52 +01:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace 'ijson = "^2.5.1"' 'ijson = "*"' \
|
|
|
|
--replace 'pytz = "^2019.3"' 'pytz = "*"' \
|
|
|
|
--replace 'oauthlib = "^3.1.0"' 'oauthlib = "*"'
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [ poetry ];
|
2020-02-10 22:10:01 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
brotli
|
2020-08-25 03:07:09 +01:00
|
|
|
ijson
|
|
|
|
python_magic
|
|
|
|
pytz
|
2020-02-10 22:10:01 +00:00
|
|
|
requests_oauthlib
|
|
|
|
];
|
|
|
|
|
2020-09-10 23:00:52 +01:00
|
|
|
checkInputs = [ nose httpretty ];
|
2020-02-10 22:10:01 +00:00
|
|
|
checkPhase = ''
|
|
|
|
nosetests --cover-package=pysnow --with-coverage --cover-erase
|
|
|
|
'';
|
2020-09-10 23:00:52 +01:00
|
|
|
pythonImportsCheck = [ "pysnow" ];
|
2020-02-10 22:10:01 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "ServiceNow HTTP client library written in Python";
|
|
|
|
homepage = "https://github.com/rbw/pysnow";
|
|
|
|
license = licenses.mit;
|
2020-08-25 03:07:09 +01:00
|
|
|
maintainers = [ maintainers.almac ];
|
2020-02-10 22:10:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|