summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/stix2/default.nix
blob: 566aa323c98d0f40a27358ad1393797b16210734 (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
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  pytestCheckHook,
  setuptools,
  haversine,
  medallion,
  pytz,
  rapidfuzz,
  requests,
  simplejson,
  stix2-patterns,
  taxii2-client,
}:

buildPythonPackage rec {
  pname = "stix2";
  version = "3.0.1";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "oasis-open";
    repo = "cti-python-stix2";
    tag = "v${version}";
    hash = "sha256-1bILZUZgPOWmFWRu4p/fmgi4QPEE1lFQH9mxoWd/saI=";
  };

  build-system = [ setuptools ];

  dependencies = [
    pytz
    requests
    simplejson
    stix2-patterns
  ];

  nativeCheckInputs = [
    pytestCheckHook
    haversine
    medallion
    rapidfuzz
    taxii2-client
  ];

  disabledTests = [
    # flaky tests
    "test_graph_equivalence_with_filesystem_source"
    "test_graph_similarity_with_filesystem_source"
    "test_object_similarity_prop_scores"
  ];

  pythonImportsCheck = [ "stix2" ];

  meta = {
    description = "Produce and consume STIX 2 JSON content";
    homepage = "https://stix2.readthedocs.io/en/latest/";
    changelog = "https://github.com/oasis-open/cti-python-stix2/blob/v${version}/CHANGELOG";
    license = lib.licenses.bsd3;
    maintainers = with lib.maintainers; [ PapayaJackal ];
  };
}