1{ lib
2, stdenv
3, buildPythonPackage
4, pythonOlder
5, fetchPypi
6, cython
7, geos
8, oldest-supported-numpy
9, setuptools
10, wheel
11, numpy
12, pytestCheckHook
13}:
14
15buildPythonPackage rec {
16 pname = "shapely";
17 version = "2.0.2";
18 format = "pyproject";
19
20 disabled = pythonOlder "3.7";
21
22 src = fetchPypi {
23 inherit pname version;
24 hash = "sha256-FxPMBMFxuv/Fslm6hTHFiswqMBcHt/Ah2IoV7QkGSec=";
25 };
26
27 nativeBuildInputs = [
28 cython
29 geos # for geos-config
30 oldest-supported-numpy
31 setuptools
32 wheel
33 ];
34
35 buildInputs = [
36 geos
37 ];
38
39 propagatedBuildInputs = [
40 numpy
41 ];
42
43 nativeCheckInputs = [
44 pytestCheckHook
45 ];
46
47 # Fix a ModuleNotFoundError. Investigated at:
48 # https://github.com/NixOS/nixpkgs/issues/255262
49 preCheck = ''
50 cd $out
51 '';
52
53 disabledTests = lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [
54 # FIXME(lf-): these logging tests are broken, which is definitely our
55 # fault. I've tried figuring out the cause and failed.
56 #
57 # It is apparently some sandbox or no-sandbox related thing on macOS only
58 # though.
59 "test_error_handler_exception"
60 "test_error_handler"
61 "test_info_handler"
62 ];
63
64 pythonImportsCheck = [ "shapely" ];
65
66 meta = with lib; {
67 changelog = "https://github.com/shapely/shapely/blob/${version}/CHANGES.txt";
68 description = "Manipulation and analysis of geometric objects";
69 homepage = "https://github.com/shapely/shapely";
70 license = licenses.bsd3;
71 maintainers = teams.geospatial.members;
72 };
73}