1{ lib 2, buildPythonPackage 3, asn1crypto 4, fetchPypi 5, openssl 6}: 7 8buildPythonPackage rec { 9 pname = "oscrypto"; 10 version = "1.2.1"; 11 12 src = fetchPypi { 13 inherit pname version; 14 sha256 = "1546si2bdgkqnbvv4mw1hr4mhh6bq39d9z4wxgv1m7fq6miclb3x"; 15 }; 16 17 testSources = fetchPypi { 18 inherit version; 19 pname = "oscrypto_tests"; 20 sha256 = "1ha68dsrbx6mlra44x0n81vscn17pajbl4yg7cqkk7mq1zfmjwks"; 21 }; 22 23 propagatedBuildInputs = [ 24 asn1crypto 25 openssl 26 ]; 27 28 preCheck = '' 29 tar -xf ${testSources} 30 mv oscrypto_tests-${version} tests 31 32 # remove tests that require network 33 sed -e '/TLSTests/d' -e '/TrustListTests/d' -i tests/__init__.py 34 ''; 35 36 pythonImportsCheck = [ "oscrypto" ]; 37 38 meta = with lib; { 39 description = "Encryption library for Python"; 40 homepage = "https://github.com/wbond/oscrypto"; 41 license = licenses.mit; 42 }; 43}