From 0a2ea18e85e1a2aa18526708c17aa8c780e1c5eb Mon Sep 17 00:00:00 2001 From: Rodney Lorrimar Date: Wed, 15 Mar 2017 20:33:25 +0000 Subject: [PATCH] pythonPackages.zeep: init at 1.1.0 Works with both Python 2.7 and 3.5. Tests won't work under Python 3.5 due to the testtools dependency. --- .../python-modules/zeep/default.nix | 91 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 3 + 2 files changed, 94 insertions(+) create mode 100644 pkgs/development/python-modules/zeep/default.nix diff --git a/pkgs/development/python-modules/zeep/default.nix b/pkgs/development/python-modules/zeep/default.nix new file mode 100644 index 000000000000..c6ae3881f1f4 --- /dev/null +++ b/pkgs/development/python-modules/zeep/default.nix @@ -0,0 +1,91 @@ +{ fetchPypi +, lib +, buildPythonPackage +, python +, isPy3k +, appdirs +, cached-property +, defusedxml +, isodate +, lxml +, pytz +, requests_toolbelt +, six +# test dependencies +, freezegun +, mock +, nose +, pretend +, pytest +, pytestcov +, requests-mock +, testtools +}: + +let + pname = "zeep"; + version = "1.1.0"; +in buildPythonPackage { + name = "${pname}-${version}"; + + src = fetchPypi { + inherit pname version; + sha256 = "83e82b6cb59e84bf4725add3771ed442bb099fad5959c887efe7c49a8a940ea5"; + }; + + propagatedBuildInputs = [ + appdirs + cached-property + defusedxml + isodate + lxml + pytz + requests_toolbelt + six + ]; + + # testtools dependency not supported for py3k + doCheck = !isPy3k; + + buildInputs = if isPy3k then [] else [ + freezegun + mock + nose + pretend + pytest + pytestcov + requests-mock + ]; + + 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 = '' + runHook preCheck + ${python.interpreter} -m pytest tests + runHook postCheck + ''; + + meta = with lib; { + homepage = "http://docs.python-zeep.org"; + license = licenses.mit; + description = "A modern/fast Python SOAP client based on lxml / requests"; + maintainers = with maintainers; [ rvl ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 5e67aac39602..0a9c43799976 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -32122,6 +32122,9 @@ EOF yenc = callPackage ../development/python-modules/yenc { }; + zeep = callPackage ../development/python-modules/zeep { + }; + zeitgeist = if isPy3k then throw "zeitgeist not supported for interpreter ${python.executable}" else (pkgs.zeitgeist.override{python2Packages=self;}).py;