Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / shapely / 1.8.nix
blob4382ba93ec5e2d2b8e99aa292f459810eb8e4537
1 { lib
2 , stdenv
3 , buildPythonPackage
4 , fetchPypi
5 , pytestCheckHook
6 , pythonOlder
7 , substituteAll
9 , cython_0
10 , geos_3_11
11 , numpy
12 , oldest-supported-numpy
13 , setuptools
14 , wheel
17 buildPythonPackage rec {
18   pname = "shapely";
19   version = "1.8.5";
20   pyproject = true;
22   disabled = pythonOlder "3.7";
24   src = fetchPypi {
25     pname = "Shapely";
26     inherit version;
27     hash = "sha256-6CttYOz7EkEgyI/hBqR4WWu+qxQhFtfn9ko2TayQKpI=";
28   };
30   # Environment variable used in shapely/_buildcfg.py
31   GEOS_LIBRARY_PATH = "${geos_3_11}/lib/libgeos_c${stdenv.hostPlatform.extensions.sharedLibrary}";
33   patches = [
34     # Patch to search form GOES .so/.dylib files in a Nix-aware way
35     (substituteAll {
36       src = ./library-paths.patch;
37       libgeos_c = GEOS_LIBRARY_PATH;
38       libc = lib.optionalString (!stdenv.isDarwin) "${stdenv.cc.libc}/lib/libc${stdenv.hostPlatform.extensions.sharedLibrary}.6";
39     })
40   ];
42   postPatch = ''
43     substituteInPlace pyproject.toml --replace "setuptools<64" "setuptools"
44   '';
46   nativeBuildInputs = [
47     cython_0
48     geos_3_11 # for geos-config
49     oldest-supported-numpy
50     setuptools
51     wheel
52   ];
54   buildInputs = [
55     geos_3_11
56   ];
58   propagatedBuildInputs = [
59     numpy
60   ];
62   nativeCheckInputs = [
63     pytestCheckHook
64   ];
66   preCheck = ''
67     rm -r shapely # prevent import of local shapely
68   '';
70   disabledTests = lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [
71     # FIXME(lf-): these logging tests are broken, which is definitely our
72     # fault. I've tried figuring out the cause and failed.
73     #
74     # It is apparently some sandbox or no-sandbox related thing on macOS only
75     # though.
76     "test_error_handler_exception"
77     "test_error_handler"
78     "test_info_handler"
79   ];
81   pythonImportsCheck = [ "shapely" ];
83   meta = with lib; {
84     changelog = "https://github.com/shapely/shapely/blob/${version}/CHANGES.txt";
85     description = "Manipulation and analysis of geometric objects";
86     homepage = "https://github.com/shapely/shapely";
87     license = licenses.bsd3;
88     maintainers = teams.geospatial.members;
89   };