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; })) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 5c86376a2441..96b5db7ee047 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -19894,7 +19894,11 @@ in { pyopencl = callPackage ../development/python-modules/pyopencl { }; - pyproj = callPackage ../development/python-modules/pyproj { }; + pyproj = callPackage ../development/python-modules/pyproj { + # pyproj does *work* if you want to use a system supplied proj, but with the current version(s) the tests fail by + # a few decimal places, so caveat emptor. + proj = null; + }; pyrr = buildPythonPackage rec { name = "pyrr-${version}";