about summary refs log tree commit diff
path: root/pkgs/development/python-modules/oscrypto/default.nix
blob: b4d1c8fb88af54938c8224b3704d2927ef8da5ea (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
, stdenv
, buildPythonPackage
, asn1crypto
, fetchPypi
, openssl
}:

buildPythonPackage rec {
  pname = "oscrypto";
  version = "1.2.1";

  src = fetchPypi {
    inherit pname version;
    sha256 = "1546si2bdgkqnbvv4mw1hr4mhh6bq39d9z4wxgv1m7fq6miclb3x";
  };

  testSources = fetchPypi {
    inherit version;
    pname = "oscrypto_tests";
    sha256 = "1ha68dsrbx6mlra44x0n81vscn17pajbl4yg7cqkk7mq1zfmjwks";
  };

  propagatedBuildInputs = [
    asn1crypto
    openssl
  ];

  preCheck = ''
    tar -xf ${testSources}
    mv oscrypto_tests-${version} tests

    # remove tests that require network
    sed -e '/TLSTests/d' -e '/TrustListTests/d' -i tests/__init__.py
  '';

  pythonImportsCheck = [ "oscrypto" ];

  doCheck = !stdenv.isDarwin;

  meta = with lib; {
    description = "Encryption library for Python";
    homepage = "https://github.com/wbond/oscrypto";
    license = licenses.mit;
  };
}