1{ 2 lib, 3 stdenv, 4 buildPythonPackage, 5 fetchPypi, 6 openssl, 7 setuptools, 8 cryptography, 9 pytestCheckHook, 10 pretend, 11 sphinxHook, 12 sphinx-rtd-theme, 13 pytest-rerunfailures, 14}: 15 16buildPythonPackage rec { 17 pname = "pyopenssl"; 18 version = "24.1.0"; 19 pyproject = true; 20 21 src = fetchPypi { 22 pname = "pyOpenSSL"; 23 inherit version; 24 hash = "sha256-yr7Uv6pd+fGhbA72Sgy2Uxi1zQd6ftp9aXATHKL0Gm8="; 25 }; 26 27 outputs = [ 28 "out" 29 "dev" 30 "doc" 31 ]; 32 33 nativeBuildInputs = [ 34 openssl 35 setuptools 36 sphinxHook 37 sphinx-rtd-theme 38 ]; 39 40 postPatch = '' 41 # remove cryptography pin 42 sed -i "/cryptography/ s/,<[0-9]*//g" setup.py 43 ''; 44 45 propagatedBuildInputs = [ cryptography ]; 46 47 nativeCheckInputs = [ 48 pretend 49 pytest-rerunfailures 50 pytestCheckHook 51 ]; 52 53 __darwinAllowLocalNetworking = true; 54 55 preCheck = '' 56 export LANG="en_US.UTF-8" 57 ''; 58 59 disabledTests = 60 [ 61 # https://github.com/pyca/pyopenssl/issues/692 62 # These tests, we disable always. 63 "test_set_default_verify_paths" 64 "test_fallback_default_verify_paths" 65 # https://github.com/pyca/pyopenssl/issues/768 66 "test_wantWriteError" 67 # https://github.com/pyca/pyopenssl/issues/1043 68 "test_alpn_call_failure" 69 ] 70 ++ lib.optionals (lib.hasPrefix "libressl" openssl.meta.name) [ 71 # https://github.com/pyca/pyopenssl/issues/791 72 # These tests, we disable in the case that libressl is passed in as openssl. 73 "test_op_no_compression" 74 "test_npn_advertise_error" 75 "test_npn_select_error" 76 "test_npn_client_fail" 77 "test_npn_success" 78 "test_use_certificate_chain_file_unicode" 79 "test_use_certificate_chain_file_bytes" 80 "test_add_extra_chain_cert" 81 "test_set_session_id_fail" 82 "test_verify_with_revoked" 83 "test_set_notAfter" 84 "test_set_notBefore" 85 ] 86 ++ lib.optionals (lib.versionAtLeast (lib.getVersion openssl.name) "1.1") [ 87 # these tests are extremely tightly wed to the exact output of the openssl cli tool, including exact punctuation. 88 "test_dump_certificate" 89 "test_dump_privatekey_text" 90 "test_dump_certificate_request" 91 "test_export_text" 92 ] 93 ++ lib.optionals stdenv.is32bit [ 94 # https://github.com/pyca/pyopenssl/issues/974 95 "test_verify_with_time" 96 ]; 97 98 meta = with lib; { 99 description = "Python wrapper around the OpenSSL library"; 100 homepage = "https://github.com/pyca/pyopenssl"; 101 changelog = "https://github.com/pyca/pyopenssl/blob/${version}/CHANGELOG.rst"; 102 license = licenses.asl20; 103 maintainers = with maintainers; [ ]; 104 }; 105}