1{ lib
2, buildPythonPackage
3, fetchPypi
4, fetchFromGitHub
5, poetry
6, brotli
7, ijson
8, nose
9, httpretty
10, requests_oauthlib
11, python_magic
12, pytz
13}:
14
15buildPythonPackage rec {
16 pname = "pysnow";
17 version = "0.7.16";
18
19 # tests not included in pypi tarball
20 src = fetchFromGitHub {
21 owner = "rbw";
22 repo = pname;
23 rev = version;
24 sha256 = "0dj90w742klfcjnx7yhp0nzki2mzafqzzr0rk2dp6vxn8h58z8ww";
25 };
26 format = "pyproject";
27
28 postPatch = ''
29 substituteInPlace pyproject.toml \
30 --replace 'ijson = "^2.5.1"' 'ijson = "*"' \
31 --replace 'pytz = "^2019.3"' 'pytz = "*"' \
32 --replace 'oauthlib = "^3.1.0"' 'oauthlib = "*"'
33 '';
34
35 nativeBuildInputs = [ poetry ];
36 propagatedBuildInputs = [
37 brotli
38 ijson
39 python_magic
40 pytz
41 requests_oauthlib
42 ];
43
44 checkInputs = [ nose httpretty ];
45 checkPhase = ''
46 nosetests --cover-package=pysnow --with-coverage --cover-erase
47 '';
48 pythonImportsCheck = [ "pysnow" ];
49
50 meta = with lib; {
51 description = "ServiceNow HTTP client library written in Python";
52 homepage = "https://github.com/rbw/pysnow";
53 license = licenses.mit;
54 maintainers = [ maintainers.almac ];
55 };
56
57}