From d4c106f5b4fb7ff2323b128c149b3217021396c0 Mon Sep 17 00:00:00 2001 From: Robert Scott Date: Wed, 17 May 2017 22:40:07 +0100 Subject: pyproj: enable tests, use bundled proj by default --- pkgs/development/python-modules/pyproj/default.nix | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'pkgs/development/python-modules/pyproj') diff --git a/pkgs/development/python-modules/pyproj/default.nix b/pkgs/development/python-modules/pyproj/default.nix index eff6f4368583..8b15c63fb206 100644 --- a/pkgs/development/python-modules/pyproj/default.nix +++ b/pkgs/development/python-modules/pyproj/default.nix @@ -1,11 +1,12 @@ { lib , buildPythonPackage , fetchPypi -, proj , python +, nose2 +, proj ? null }: -buildPythonPackage rec { +buildPythonPackage (rec { pname = "pyproj"; version = "1.9.5.1"; name = "${pname}-${version}"; @@ -15,14 +16,19 @@ buildPythonPackage rec { sha256 = "53fa54c8fa8a1dfcd6af4bf09ce1aae5d4d949da63b90570ac5ec849efaf3ea8"; }; - buildInputs = [ proj ]; + buildInputs = [ nose2 ]; - # Could not get tests working - doCheck = false; + checkPhase = '' + runHook preCheck + pushd unittest # changing directory should ensure we're importing the global pyproj + ${python.interpreter} test.py && ${python.interpreter} -c "import doctest, pyproj, sys; sys.exit(doctest.testmod(pyproj)[0])" + popd + runHook postCheck + ''; meta = { description = "Python interface to PROJ.4 library"; homepage = http://github.com/jswhit/pyproj; license = with lib.licenses; [ isc ]; }; -} +} // (if proj == null then {} else { PROJ_DIR = proj; })) -- cgit 1.4.1