diff options
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/pyproj/default.nix')
-rw-r--r-- | nixpkgs/pkgs/development/python-modules/pyproj/default.nix | 55 |
1 files changed, 34 insertions, 21 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/pyproj/default.nix b/nixpkgs/pkgs/development/python-modules/pyproj/default.nix index f08625f62b6d..0f2763faf609 100644 --- a/nixpkgs/pkgs/development/python-modules/pyproj/default.nix +++ b/nixpkgs/pkgs/development/python-modules/pyproj/default.nix @@ -1,38 +1,51 @@ -{ lib -, buildPythonPackage -, fetchFromGitHub -, python -, nose2 +{ lib, buildPythonPackage, fetchFromGitHub, 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.2"; src = fetchFromGitHub { - owner = "jswhit"; - repo = pname; - rev = "78540f5ff40da92160f80860416c91ee74b7643c"; - sha256 = "1vq5smxmpdjxialxxglsfh48wx8kaq9sc5mqqxn4fgv1r5n1m3n9"; + owner = "pyproj4"; + repo = "pyproj"; + rev = "v${version}rel"; + sha256 = "0mb0jczgqh3sma69k7237i38h09gxgmvmddls9hpw4f3131f5ax7"; }; - 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; })) +} |