about summary refs log tree commit diff
path: root/pkgs/development/python-modules/rsa/default.nix
blob: e6ae0e7fd61eba3ff7fe96f5a7cabde4490b3d29 (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
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  poetry-core,
  pyasn1,
  pytestCheckHook,
  pythonOlder,
}:

buildPythonPackage rec {
  pname = "rsa";
  version = "4.9";
  format = "pyproject";

  disabled = pythonOlder "3.6";

  src = fetchFromGitHub {
    owner = "sybrenstuvel";
    repo = "python-rsa";
    rev = "version-${version}";
    hash = "sha256-PwaRe+ICy0UoguXSMSh3PFl5R+YAhJwNdNN9isadlJY=";
  };

  preConfigure = lib.optionalString (pythonOlder "3.7") ''
    substituteInPlace setup.py --replace "open('README.md')" "open('README.md',encoding='utf-8')"
  '';

  nativeBuildInputs = [ poetry-core ];

  propagatedBuildInputs = [ pyasn1 ];

  preCheck = ''
    sed -i '/addopts/d' tox.ini
  '';

  nativeCheckInputs = [ pytestCheckHook ];

  disabledTestPaths = [ "tests/test_mypy.py" ];

  meta = with lib; {
    homepage = "https://stuvel.eu/rsa";
    license = licenses.asl20;
    description = "Pure-Python RSA implementation";
  };
}