From 9eb2beaa6f663607c01df7b5feb2746bad4b155b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Tue, 13 Dec 2022 18:45:40 -0800 Subject: [PATCH] python310Packages.shapely: 1.8.4 -> 2.0.0 https://shapely.readthedocs.io/en/latest/release/2.x.html#version-2-0-0 --- .../python-modules/shapely/default.nix | 44 +++++++++---------- .../shapely/library-paths.patch | 31 ------------- 2 files changed, 20 insertions(+), 55 deletions(-) delete mode 100644 pkgs/development/python-modules/shapely/library-paths.patch diff --git a/pkgs/development/python-modules/shapely/default.nix b/pkgs/development/python-modules/shapely/default.nix index fda2645105f6..a74e6c46830e 100644 --- a/pkgs/development/python-modules/shapely/default.nix +++ b/pkgs/development/python-modules/shapely/default.nix @@ -1,28 +1,35 @@ { lib , stdenv , buildPythonPackage -, fetchPypi -, substituteAll , pythonOlder -, geos -, pytestCheckHook +, fetchPypi , cython +, geos +, setuptools , numpy +, pytestCheckHook }: buildPythonPackage rec { - pname = "Shapely"; - version = "1.8.4"; - disabled = pythonOlder "3.6"; + pname = "shapely"; + version = "2.0.0"; + disabled = pythonOlder "3.7"; + + format = "pyproject"; src = fetchPypi { inherit pname version; - sha256 = "sha256-oZXlHKr6IYKR8suqP+9p/TNTyT7EtlsqRyLEz0DDGYw="; + sha256 = "sha256-EfGxIxpsBCE/sSJsaWjRsbOzaexC0ellUGavh2MYYOo="; }; nativeBuildInputs = [ - geos # for geos-config cython + geos # for geos-config + setuptools + ]; + + buildInputs = [ + geos ]; propagatedBuildInputs = [ @@ -33,18 +40,6 @@ buildPythonPackage rec { pytestCheckHook ]; - # Environment variable used in shapely/_buildcfg.py - GEOS_LIBRARY_PATH = "${geos}/lib/libgeos_c${stdenv.hostPlatform.extensions.sharedLibrary}"; - - patches = [ - # Patch to search form GOES .so/.dylib files in a Nix-aware way - (substituteAll { - src = ./library-paths.patch; - libgeos_c = GEOS_LIBRARY_PATH; - libc = lib.optionalString (!stdenv.isDarwin) "${stdenv.cc.libc}/lib/libc${stdenv.hostPlatform.extensions.sharedLibrary}.6"; - }) - ]; - preCheck = '' rm -r shapely # prevent import of local shapely ''; @@ -63,9 +58,10 @@ buildPythonPackage rec { pythonImportsCheck = [ "shapely" ]; meta = with lib; { - description = "Geometric objects, predicates, and operations"; - homepage = "https://pypi.python.org/pypi/Shapely/"; - license = with licenses; [ bsd3 ]; + changelog = "https://github.com/shapely/shapely/blob/${version}/CHANGES.txt"; + description = "Manipulation and analysis of geometric objects"; + homepage = "https://github.com/shapely/shapely"; + license = licenses.bsd3; maintainers = with maintainers; [ knedlsepp ]; }; } diff --git a/pkgs/development/python-modules/shapely/library-paths.patch b/pkgs/development/python-modules/shapely/library-paths.patch deleted file mode 100644 index d095eada9d6e..000000000000 --- a/pkgs/development/python-modules/shapely/library-paths.patch +++ /dev/null @@ -1,31 +0,0 @@ -diff --git a/shapely/geos.py b/shapely/geos.py -index 88c5f53..1ccd6e4 100644 ---- a/shapely/geos.py -+++ b/shapely/geos.py -@@ -96,6 +96,7 @@ if sys.platform.startswith('linux'): - alt_paths = [ - 'libgeos_c.so.1', - 'libgeos_c.so', -+ '@libgeos_c@', - ] - _lgeos = load_dll('geos_c', fallbacks=alt_paths) - -@@ -160,6 +161,7 @@ elif sys.platform == 'darwin': - "/usr/local/lib/libgeos_c.dylib", - # homebrew Apple Silicon - "/opt/homebrew/lib/libgeos_c.dylib", -+ "@libgeos_c@", - ] - _lgeos = load_dll('geos_c', fallbacks=alt_paths) - -diff --git a/tests/test_dlls.py b/tests/test_dlls.py -index c71da8e..c36262c 100644 ---- a/tests/test_dlls.py -+++ b/tests/test_dlls.py -@@ -18,4 +18,5 @@ class LoadingTestCase(unittest.TestCase): - '/opt/homebrew/lib/libgeos_c.dylib', # homebrew (macOS) - os.path.join(sys.prefix, "lib", "libgeos_c.so"), # anaconda (Linux) - 'libgeos_c.so.1', -- 'libgeos_c.so']) -+ 'libgeos_c.so', -+ '@libgeos_c@'])