nixpkgs/pkgs/development/python-modules/pysnow/default.nix

58 lines
1.1 KiB
Nix
Raw Normal View History

2020-02-10 22:10:01 +00:00
{ lib
, buildPythonPackage
, fetchPypi
, fetchFromGitHub
, poetry
2020-02-10 22:10:01 +00:00
, brotli
, ijson
, nose
, 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";
version = "0.7.16";
2020-08-25 03:07:09 +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
};
format = "pyproject";
2020-02-10 22:10:01 +00: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
];
checkInputs = [ nose httpretty ];
2020-02-10 22:10:01 +00:00
checkPhase = ''
nosetests --cover-package=pysnow --with-coverage --cover-erase
'';
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
};
}