python.pkgs.zeep: enable tests for python3

This commit is contained in:
Robert Schütz 2019-04-11 18:17:31 +02:00
parent 8b4269bc1e
commit b716b4d732

View File

@ -1,26 +1,27 @@
{ fetchPypi { fetchPypi
, lib , lib
, buildPythonPackage , buildPythonPackage
, python
, isPy3k , isPy3k
, appdirs , appdirs
, attrs
, cached-property , cached-property
, defusedxml , defusedxml
, isodate , isodate
, lxml , lxml
, pytz , requests
, requests_toolbelt , requests_toolbelt
, six , six
, pytz
, tornado
, aiohttp
# test dependencies # test dependencies
, freezegun , freezegun
, mock , mock
, nose
, pretend , pretend
, pytest , pytest_3
, pytestcov , pytestcov
, requests-mock , requests-mock
, tornado , aioresponses
, attrs
}: }:
buildPythonPackage rec { buildPythonPackage rec {
@ -33,56 +34,34 @@ buildPythonPackage rec {
}; };
propagatedBuildInputs = [ propagatedBuildInputs = [
attrs
appdirs appdirs
attrs
cached-property cached-property
defusedxml defusedxml
isodate isodate
lxml lxml
pytz requests
requests_toolbelt requests_toolbelt
six six
]; pytz
# testtools dependency not supported for py3k # optional requirements
doCheck = !isPy3k; tornado
] ++ lib.optional isPy3k aiohttp;
checkInputs = [ checkInputs = [
tornado
];
buildInputs = if isPy3k then [] else [
freezegun freezegun
mock mock
nose
pretend pretend
pytest
pytestcov pytestcov
pytest_3
requests-mock requests-mock
]; ] ++ lib.optional isPy3k aioresponses;
patchPhase = ''
# remove overly strict bounds and lint requirements
sed -e "s/freezegun==.*'/freezegun'/" \
-e "s/pytest-cov==.*'/pytest-cov'/" \
-e "s/'isort.*//" \
-e "s/'flake8.*//" \
-i setup.py
# locale.preferredencoding() != 'utf-8'
sed -e "s/xsd', 'r')/xsd', 'r', encoding='utf-8')/" -i tests/*.py
# cache defaults to home directory, which doesn't exist
sed -e "s|SqliteCache()|SqliteCache(path='./zeeptest.db')|" \
-i tests/test_transports.py
# requires xmlsec python module
rm tests/test_wsse_signature.py
'';
checkPhase = '' checkPhase = ''
runHook preCheck runHook preCheck
${python.interpreter} -m pytest tests # ignored tests requires xmlsec python module
HOME=$(mktemp -d) pytest tests --ignore tests/test_wsse_signature.py
runHook postCheck runHook postCheck
''; '';