From f032f1b50ce3bc0640442cfd1491d9d14729cfd9 Mon Sep 17 00:00:00 2001 From: Ivan Mincik Date: Mon, 26 Aug 2024 10:15:33 +0200 Subject: [PATCH] pkgs: add pystac package --- flake.nix | 3 ++ overrides.nix | 10 +++++++ pkgs/pystac/default.nix | 53 +++++++++++++++++++++++++++++++++++ pkgs/pystac/nixpkgs/files.txt | 1 + 4 files changed, 67 insertions(+) create mode 100644 pkgs/pystac/default.nix create mode 100644 pkgs/pystac/nixpkgs/files.txt diff --git a/flake.nix b/flake.nix index 494ccd3d..d10159c8 100644 --- a/flake.nix +++ b/flake.nix @@ -151,6 +151,8 @@ withSerialPort = true; }; + pystac = py.pkgs.callPackage ./pkgs/pystac { }; + rasterio = py.pkgs.callPackage ./pkgs/rasterio { inherit gdal shapely; }; @@ -171,6 +173,7 @@ pyogrio pyproj pyqt5 + pystac rasterio shapely ]; diff --git a/overrides.nix b/overrides.nix index 2fcb2f03..82f2285f 100644 --- a/overrides.nix +++ b/overrides.nix @@ -221,6 +221,16 @@ rec { pyqt5 = geopkgs."${pythonVersion}-pyqt5"; # nothing to override here + ##################################################################### + ### PYTHON3-PYSTAC + ##################################################################### + + pystac = (geopkgs."${pythonVersion}-pystac".overrideAttrs (old: { + + # >>> CUSTOMIZE HERE + + })).override { }; + ##################################################################### ### PYTHON3-RASTERIO ##################################################################### diff --git a/pkgs/pystac/default.nix b/pkgs/pystac/default.nix new file mode 100644 index 00000000..eb7f653d --- /dev/null +++ b/pkgs/pystac/default.nix @@ -0,0 +1,53 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + pytestCheckHook, + pythonOlder, + + html5lib, + jsonschema, + pytest-cov, + pytest-mock, + pytest-recording, + python-dateutil, + requests-mock, + setuptools, +}: + +buildPythonPackage rec { + pname = "pystac"; + version = "1.10.1"; + pyproject = true; + disabled = pythonOlder "3.9"; + + src = fetchFromGitHub { + owner = "stac-utils"; + repo = "pystac"; + rev = "v${version}"; + hash = "sha256-zJGDhKRX50Muo1YDEzfwypMLISnYBYKkPvUULYkUf68="; + }; + + build-system = [ setuptools ]; + + propagatedBuildInputs = [ python-dateutil ]; + + nativeCheckInputs = [ + html5lib + jsonschema + pytestCheckHook + pytest-cov + pytest-mock + pytest-recording + requests-mock + ]; + + pythonImportsCheck = [ "pystac" ]; + + meta = { + description = "Python library for working with any SpatioTemporal Asset Catalog (STAC)"; + homepage = "https://github.com/stac-utils/pystac"; + license = lib.licenses.asl20; + maintainers = lib.teams.geospatial.members; + }; +} diff --git a/pkgs/pystac/nixpkgs/files.txt b/pkgs/pystac/nixpkgs/files.txt new file mode 100644 index 00000000..671f1b68 --- /dev/null +++ b/pkgs/pystac/nixpkgs/files.txt @@ -0,0 +1 @@ +pkgs/development/python-modules/pystac/* pkgs/pystac/