pythonPackages.pysnow: fix build & tests
This commit is contained in:
parent
ef82f49fc0
commit
9627ae4f9a
|
@ -1,11 +1,12 @@
|
||||||
{ lib
|
{ lib
|
||||||
, buildPythonPackage
|
, buildPythonPackage
|
||||||
, fetchPypi
|
, fetchPypi
|
||||||
, isPy27
|
, fetchFromGitHub
|
||||||
, pythonAtLeast
|
, poetry
|
||||||
, brotli
|
, brotli
|
||||||
, ijson
|
, ijson
|
||||||
, nose
|
, nose
|
||||||
|
, httpretty
|
||||||
, requests_oauthlib
|
, requests_oauthlib
|
||||||
, python_magic
|
, python_magic
|
||||||
, pytz
|
, pytz
|
||||||
|
@ -15,11 +16,23 @@ buildPythonPackage rec {
|
||||||
pname = "pysnow";
|
pname = "pysnow";
|
||||||
version = "0.7.16";
|
version = "0.7.16";
|
||||||
|
|
||||||
src = fetchPypi {
|
# tests not included in pypi tarball
|
||||||
inherit pname version;
|
src = fetchFromGitHub {
|
||||||
sha256 = "5df61091470e48b5b3a6ea75637f69d3aacae20041487ea457a9a0e3093fba8c";
|
owner = "rbw";
|
||||||
|
repo = pname;
|
||||||
|
rev = version;
|
||||||
|
sha256 = "0dj90w742klfcjnx7yhp0nzki2mzafqzzr0rk2dp6vxn8h58z8ww";
|
||||||
};
|
};
|
||||||
|
format = "pyproject";
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
substituteInPlace pyproject.toml \
|
||||||
|
--replace 'ijson = "^2.5.1"' 'ijson = "*"' \
|
||||||
|
--replace 'pytz = "^2019.3"' 'pytz = "*"' \
|
||||||
|
--replace 'oauthlib = "^3.1.0"' 'oauthlib = "*"'
|
||||||
|
'';
|
||||||
|
|
||||||
|
nativeBuildInputs = [ poetry ];
|
||||||
propagatedBuildInputs = [
|
propagatedBuildInputs = [
|
||||||
brotli
|
brotli
|
||||||
ijson
|
ijson
|
||||||
|
@ -28,11 +41,11 @@ buildPythonPackage rec {
|
||||||
requests_oauthlib
|
requests_oauthlib
|
||||||
];
|
];
|
||||||
|
|
||||||
checkInputs = [ nose ];
|
checkInputs = [ nose httpretty ];
|
||||||
|
|
||||||
checkPhase = ''
|
checkPhase = ''
|
||||||
nosetests --cover-package=pysnow --with-coverage --cover-erase
|
nosetests --cover-package=pysnow --with-coverage --cover-erase
|
||||||
'';
|
'';
|
||||||
|
pythonImportsCheck = [ "pysnow" ];
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "ServiceNow HTTP client library written in Python";
|
description = "ServiceNow HTTP client library written in Python";
|
||||||
|
|
Loading…
Reference in a new issue