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