Merge pull request #211217 from nialov/fix-pygeos-version-0.14

python3Packages.pygeos: fix version 0.14 build
This commit is contained in:
Fabian Affolter 2023-01-17 13:46:50 +01:00 committed by GitHub
commit 11d29ac93d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 39 deletions

View file

@ -14,21 +14,17 @@ buildPythonPackage rec {
src = fetchPypi { src = fetchPypi {
inherit pname version; inherit pname version;
sha256 = "sha256-MPvBf2SEQgC4UTO4hfz7ZVQbh3lTH270+P5GfT+6diM="; hash = "sha256-MPvBf2SEQgC4UTO4hfz7ZVQbh3lTH270+P5GfT+6diM=";
}; };
patches = [
# Adapt https://github.com/shapely/shapely/commit/4889bd2d72ff500e51ba70d5b954241878349562,
# backporting to pygeos
./fix-for-geos-3-11.patch
];
nativeBuildInputs = [ nativeBuildInputs = [
geos # for geos-config geos # for geos-config
cython cython
]; ];
propagatedBuildInputs = [ numpy ]; propagatedBuildInputs = [
numpy
];
# The cythonized extensions are required to exist in the pygeos/ directory # The cythonized extensions are required to exist in the pygeos/ directory
# for the package to function. Therefore override of buildPhase was # for the package to function. Therefore override of buildPhase was
@ -42,11 +38,14 @@ buildPythonPackage rec {
pytestCheckHook pytestCheckHook
]; ];
pythonImportsCheck = [ "pygeos" ]; pythonImportsCheck = [
"pygeos"
];
meta = with lib; { meta = with lib; {
description = "Wraps GEOS geometry functions in numpy ufuncs."; description = "Wraps GEOS geometry functions in numpy ufuncs";
homepage = "https://github.com/pygeos/pygeos"; homepage = "https://github.com/pygeos/pygeos";
changelog = "https://github.com/pygeos/pygeos/blob/${version}/CHANGELOG.rst";
license = licenses.bsd3; license = licenses.bsd3;
maintainers = with maintainers; [ nialov ]; maintainers = with maintainers; [ nialov ];
}; };

View file

@ -1,29 +0,0 @@
From ea82dbefeb573150935eb78a6916813775512e76 Mon Sep 17 00:00:00 2001
From: Joris Van den Bossche <jorisvandenbossche@gmail.com>
Date: Tue, 26 Apr 2022 22:17:00 +0200
Subject: [PATCH] TST: fix tests for GEOS main (#1357) (backported for nixpkgs)
---
pygeos/tests/test_constructive.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/pygeos/tests/test_constructive.py b/pygeos/tests/test_constructive.py
index 87c0a9f..b3459d1 100644
--- a/pygeos/tests/test_constructive.py
+++ b/pygeos/tests/test_constructive.py
@@ -48,7 +48,11 @@ def test_no_args_array(geometry, func):
@pytest.mark.parametrize("geometry", all_types)
@pytest.mark.parametrize("func", CONSTRUCTIVE_FLOAT_ARG)
def test_float_arg_array(geometry, func):
- if func is pygeos.offset_curve and pygeos.get_type_id(geometry) not in [1, 2]:
+ if (
+ func is pygeos.offset_curve
+ and pygeos.get_type_id(geometry) not in [1, 2]
+ and pygeos.geos_version < (3, 11, 0)
+ ):
with pytest.raises(GEOSException, match="only accept linestrings"):
func([geometry, geometry], 0.0)
return
--
2.36.1