nixpkgs/pkgs/development/python-modules/python-jsonpath/default.nix
2025-11-03 10:13:17 -08:00

54 lines
1.2 KiB
Nix

{
buildPythonPackage,
fetchFromGitHub,
hatchling,
lib,
pytestCheckHook,
regex,
}:
buildPythonPackage rec {
pname = "python-jsonpath";
version = "2.0.1";
pyproject = true;
src = fetchFromGitHub {
owner = "jg-rp";
repo = "python-jsonpath";
tag = "v${version}";
fetchSubmodules = true;
preFetch = ''
# can't clone using ssh
# https://github.com/jg-rp/python-jsonpath/pull/122
export GIT_CONFIG_COUNT=1
export GIT_CONFIG_KEY_0=url.https://github.com/.insteadOf
export GIT_CONFIG_VALUE_0=git@github.com:
'';
hash = "sha256-DiXBIo/I36rrn+RCQda+khfViCnzHwiGzK2X9ACF3io=";
};
build-system = [ hatchling ];
optional-dependencies = {
strict = [
# FIXME package iregexp-check
regex
];
};
pythonImportsCheck = [ "jsonpath" ];
nativeCheckInputs = [
pytestCheckHook
]
++ optional-dependencies.strict;
meta = {
changelog = "https://github.com/jg-rp/python-jsonpath/blob/${src.tag}/CHANGELOG.md";
description = "Flexible JSONPath engine for Python with JSON Pointer and JSON Patch";
homepage = "https://github.com/jg-rp/python-jsonpath";
license = lib.licenses.mit;
maintainers = [ lib.maintainers.dotlambda ];
};
}