about summary refs log tree commit diff
path: root/pkgs/development/python-modules/cryptodatahub/default.nix
blob: 0a42e56d405a526d6d93972b8daf594eb45adc9b (plain) (blame)
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
67
68
69
70
71
72
73
74
{ lib
, asn1crypto
, attrs
, beautifulsoup4
, buildPythonPackage
, fetchFromGitLab
, pathlib2
, pyfakefs
, python-dateutil
, pythonOlder
, setuptools
, six
, unittestCheckHook
, urllib3
}:

buildPythonPackage rec {
  pname = "cryptodatahub";
  version = "0.12.4";
  pyproject = true;

  disabled = pythonOlder "3.7";

  src = fetchFromGitLab {
    owner = "coroner";
    repo = "cryptodatahub";
    rev = "refs/tags/v${version}";
    hash = "sha256-+IGzXYSaeZjN5AxBu7jXgrnGtrtaSveFiVeNQRBZMNg=";
  };

  postPatch = ''
    substituteInPlace requirements.txt  \
      --replace-fail "attrs>=20.3.0,<22.0.1" "attrs>=20.3.0"
  '';

  build-system = [
    setuptools
  ];

  dependencies = [
    asn1crypto
    attrs
    pathlib2
    python-dateutil
    six
    urllib3
  ];

  nativeCheckInputs = [
    beautifulsoup4
    pyfakefs
    unittestCheckHook
  ];

  pythonImportsCheck = [
    "cryptodatahub"
  ];


  preCheck = ''
    # failing tests
    rm test/updaters/test_common.py
    # Tests require network access
    rm test/common/test_utils.py
  '';

  meta = with lib; {
    description = "Repository of cryptography-related data";
    homepage = "https://gitlab.com/coroner/cryptodatahub";
    changelog = "https://gitlab.com/coroner/cryptodatahub/-/blob/${version}/CHANGELOG.rst";
    license = licenses.mpl20;
    maintainers = with maintainers; [ ];
  };
}