From a06ca42c14d0de662cf970e713d174dcd66af608 Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Thu, 17 Oct 2024 08:57:42 -0400 Subject: [PATCH] python3.pkgs.geoarrow-pyarrow: init at 0.1.2 --- .../geoarrow-pyarrow/default.nix | 77 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 79 insertions(+) create mode 100644 pkgs/development/python-modules/geoarrow-pyarrow/default.nix diff --git a/pkgs/development/python-modules/geoarrow-pyarrow/default.nix b/pkgs/development/python-modules/geoarrow-pyarrow/default.nix new file mode 100644 index 000000000000..197962bf15b2 --- /dev/null +++ b/pkgs/development/python-modules/geoarrow-pyarrow/default.nix @@ -0,0 +1,77 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + pythonOlder, + pytestCheckHook, + geoarrow-c, + pyarrow, + pyarrow-hotfix, + numpy, + pandas, + geopandas, + pyogrio, + pyproj, + setuptools-scm, +}: +buildPythonPackage rec { + pname = "geoarrow-pyarrow"; + version = "0.1.2"; + pyproject = true; + + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + repo = "geoarrow-python"; + owner = "geoarrow"; + rev = "refs/tags/geoarrow-pyarrow-${version}"; + hash = "sha256-Ni+GKTRhRDRHip1us3OZPuUhHQCNU7Nap865T/+CU8Y="; + }; + + sourceRoot = "${src.name}/geoarrow-pyarrow"; + + build-system = [ setuptools-scm ]; + + disabledTests = [ + # these tests are incompatible with arrow 17 + "test_make_point" + "test_point_with_offset" + "test_linestring_with_offset" + "test_polygon_with_offset" + "test_multipoint_with_offset" + "test_multilinestring_with_offset" + "test_multipolygon_with_offset" + "test_multipolygon_with_offset_nonempty_inner_lists" + "test_interleaved_multipolygon_with_offset" + "test_readpyogrio_table_gpkg" + "test_geometry_type_basic" + ]; + + dependencies = [ + geoarrow-c + pyarrow + pyarrow-hotfix + ]; + + env.SETUPTOOLS_SCM_PRETEND_VERSION = version; + + nativeCheckInputs = [ + pytestCheckHook + numpy + pandas + geopandas + pyogrio + pyproj + ]; + + pythonImportsCheck = [ "geoarrow.pyarrow" ]; + + meta = with lib; { + description = "PyArrow implementation of geospatial data types"; + homepage = "https://github.com/geoarrow/geoarrow-python"; + license = licenses.asl20; + maintainers = with maintainers; [ + cpcloud + ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 7c622a65bfbb..7fd6858f9d17 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4968,6 +4968,8 @@ self: super: with self; { geoarrow-types = callPackage ../development/python-modules/geoarrow-types { }; + geoarrow-pyarrow = callPackage ../development/python-modules/geoarrow-pyarrow { }; + geocachingapi = callPackage ../development/python-modules/geocachingapi { }; geocoder = callPackage ../development/python-modules/geocoder { };