diff --git a/pkgs/development/python-modules/fiona/default.nix b/pkgs/development/python-modules/fiona/default.nix index fec7fac990cd..3e9430ef318b 100644 --- a/pkgs/development/python-modules/fiona/default.nix +++ b/pkgs/development/python-modules/fiona/default.nix @@ -1,29 +1,46 @@ -{ stdenv, lib, buildPythonPackage, fetchPypi, isPy3k, pythonOlder, cython -, attrs, click, cligj, click-plugins, six, munch, enum34 -, pytestCheckHook, boto3, mock, giflib, pytz -, gdal, certifi +{ lib +, buildPythonPackage +, pythonOlder +, fetchFromGitHub +, cython +, gdal +, setuptools +, attrs +, certifi +, click +, click-plugins +, cligj +, munch +, shapely +, boto3 +, pytestCheckHook +, pytz }: buildPythonPackage rec { pname = "fiona"; - version = "1.9.0"; + version = "1.9.1"; - src = fetchPypi { - pname = "Fiona"; - inherit version; - hash = "sha256-bkh8v7pahJ+98G5FFp/X4fFmL0Tz1xerS5RgRrJFfq4="; + disabled = pythonOlder "3.7"; + + format = "pyproject"; + + src = fetchFromGitHub { + owner = "Toblerity"; + repo = "Fiona"; + rev = "refs/tags/${version}"; + hash = "sha256-2CGLkgnpCAh9G+ILol5tmRj9S6/XeKk8eLzGEODiyP8="; }; - CXXFLAGS = lib.optionalString stdenv.cc.isClang "-std=c++11"; - nativeBuildInputs = [ cython gdal # for gdal-config + setuptools ]; buildInputs = [ gdal - ] ++ lib.optionals stdenv.cc.isClang [ giflib ]; + ]; propagatedBuildInputs = [ attrs @@ -31,32 +48,33 @@ buildPythonPackage rec { click cligj click-plugins - six munch - pytz - ] ++ lib.optional (!isPy3k) enum34; + setuptools + ]; + + passthru.optional-dependencies = { + calc = [ shapely ]; + s3 = [ boto3 ]; + }; nativeCheckInputs = [ pytestCheckHook - boto3 - ] ++ lib.optional (pythonOlder "3.4") mock; + pytz + ] ++ passthru.optional-dependencies.s3; preCheck = '' rm -r fiona # prevent importing local fiona - # disable gdal deprecation warnings - export GDAL_ENABLE_DEPRECATED_DRIVER_GTM=YES ''; disabledTests = [ # Some tests access network, others test packaging "http" "https" "wheel" - # https://github.com/Toblerity/Fiona/issues/1164 - "test_no_append_driver_cannot_append" ]; pythonImportsCheck = [ "fiona" ]; meta = with lib; { + changelog = "https://github.com/Toblerity/Fiona/blob/${src.rev}/CHANGES.txt"; description = "OGR's neat, nimble, no-nonsense API for Python"; homepage = "https://fiona.readthedocs.io/"; license = licenses.bsd3;