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