summaryrefslogtreecommitdiffstats
path: root/pkgs/development/python-modules/cel-python/default.nix
blob: 46ce25d6976743152d08820ec1759fce99a444b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
{
  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 ];
  };
})