Files
nixpkgs/pkgs/development/python-modules/cel-python/default.nix
2026-08-02 20:26:08 +00:00

67 lines
1.2 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
# build-system
hatchling,
# dependencies
google-re2,
jmespath,
lark,
pendulum,
pyyaml,
# tests
pytestCheckHook,
}:
buildPythonPackage (finalAttrs: {
pname = "cel-python";
version = "0.5.0";
pyproject = true;
__structuredAttrs = true;
src = fetchFromGitHub {
owner = "cloud-custodian";
repo = "cel-python";
tag = "v${lib.versions.majorMinor finalAttrs.version}";
hash = "sha256-DPHgHRvzQnBzjl2y9yNWt330xF535dO0iBObuqlr+PI=";
};
build-system = [ hatchling ];
dependencies = [
google-re2
jmespath
lark
pendulum
pyyaml
];
pythonImportsCheck = [ "celpy" ];
nativeCheckInputs = [
pytestCheckHook
];
enabledTestPaths = [
"tests"
];
disabledTestPaths = [
# Require cloud-custodian (c7n)
"tests/test_c7n_to_cel.py"
"tests/test_c7nlib.py"
];
meta = {
description = "Pure Python implementation of the Common Expression Language";
homepage = "https://github.com/cloud-custodian/cel-python";
changelog = "https://github.com/cloud-custodian/cel-python/releases/tag/${finalAttrs.src.tag}";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ GaetanLepage ];
};
})