diff options
Diffstat (limited to 'pkgs/development/python-modules/pyproj/default.nix')
-rw-r--r-- | pkgs/development/python-modules/pyproj/default.nix | 55 |
1 files changed, 33 insertions, 22 deletions
diff --git a/pkgs/development/python-modules/pyproj/default.nix b/pkgs/development/python-modules/pyproj/default.nix index f08625f62b6..ddfecbe8ec5 100644 --- a/pkgs/development/python-modules/pyproj/default.nix +++ b/pkgs/development/python-modules/pyproj/default.nix @@ -1,38 +1,49 @@ -{ lib -, buildPythonPackage -, fetchFromGitHub -, python -, nose2 +{ lib, buildPythonPackage, fetchPypi, python, pkgs, pythonOlder, substituteAll +, aenum , cython -, proj ? null +, pytest +, mock +, numpy }: -buildPythonPackage (rec { +buildPythonPackage rec { pname = "pyproj"; - version = "unstable-2018-11-13"; + version = "2.2.1"; - src = fetchFromGitHub { - owner = "jswhit"; - repo = pname; - rev = "78540f5ff40da92160f80860416c91ee74b7643c"; - sha256 = "1vq5smxmpdjxialxxglsfh48wx8kaq9sc5mqqxn4fgv1r5n1m3n9"; + src = fetchPypi { + inherit pname version; + sha256 = "0yigcxwmx5cczipf2mpmy2gq1dnl0635yjvjq86ay47j1j5fd2gc"; }; - buildInputs = [ cython ]; + # force pyproj to use ${pkgs.proj} + patches = [ + (substituteAll { + src = ./001.proj.patch; + proj = pkgs.proj; + }) + ]; - checkInputs = [ nose2 ]; + buildInputs = [ cython pkgs.proj ]; + propagatedBuildInputs = [ + numpy + ] ++ lib.optional (pythonOlder "3.6") aenum; + + checkInputs = [ pytest mock ]; + + # ignore rounding errors, and impure docgen + # datadir is ignored because it does the proj look up logic, which isn't relevant 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 + pytest . -k 'not alternative_grid_name \ + and not transform_wgs84_to_alaska \ + and not repr' \ + --ignore=test/test_doctest_wrapper.py \ + --ignore=test/test_datadir.py ''; meta = { description = "Python interface to PROJ.4 library"; - homepage = https://github.com/jswhit/pyproj; + homepage = "https://github.com/jswhit/pyproj"; license = with lib.licenses; [ isc ]; }; -} // (if proj == null then {} else { PROJ_DIR = proj; })) +} |