Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / pyopenssl / default.nix
blob31e9e810c9edd1d123f279291dcfdc1210304850
1 { lib
2 , stdenv
3 , buildPythonPackage
4 , fetchPypi
5 , openssl
6 , setuptools
7 , cryptography
8 , pytestCheckHook
9 , pretend
10 , sphinxHook
11 , sphinx-rtd-theme
12 , flaky
15 buildPythonPackage rec {
16   pname = "pyopenssl";
17   version = "24.0.0";
18   pyproject = true;
20   src = fetchPypi {
21     pname = "pyOpenSSL";
22     inherit version;
23     hash = "sha256-aqMwOak//6RWPmVbYdETZNASZL6My0mQYQHgKjNFML8=";
24   };
26   outputs = [
27     "out"
28     "dev"
29     "doc"
30   ];
32   nativeBuildInputs = [
33     openssl
34     setuptools
35     sphinxHook
36     sphinx-rtd-theme
37   ];
39   postPatch = ''
40     # remove cryptography pin
41     sed -i "/cryptography/ s/,<[0-9]*//g" setup.py
42   '';
44   propagatedBuildInputs = [
45     cryptography
46   ];
48   nativeCheckInputs = [
49     flaky
50     pretend
51     pytestCheckHook
52   ];
54   __darwinAllowLocalNetworking = true;
56   preCheck = ''
57     export LANG="en_US.UTF-8"
58   '';
60   disabledTests = [
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   ] ++ lib.optionals (lib.hasPrefix "libressl" openssl.meta.name) [
70     # https://github.com/pyca/pyopenssl/issues/791
71     # These tests, we disable in the case that libressl is passed in as openssl.
72     "test_op_no_compression"
73     "test_npn_advertise_error"
74     "test_npn_select_error"
75     "test_npn_client_fail"
76     "test_npn_success"
77     "test_use_certificate_chain_file_unicode"
78     "test_use_certificate_chain_file_bytes"
79     "test_add_extra_chain_cert"
80     "test_set_session_id_fail"
81     "test_verify_with_revoked"
82     "test_set_notAfter"
83     "test_set_notBefore"
84   ] ++ lib.optionals (lib.versionAtLeast (lib.getVersion openssl.name) "1.1") [
85     # these tests are extremely tightly wed to the exact output of the openssl cli tool, including exact punctuation.
86     "test_dump_certificate"
87     "test_dump_privatekey_text"
88     "test_dump_certificate_request"
89     "test_export_text"
90   ] ++ lib.optionals stdenv.is32bit [
91     # https://github.com/pyca/pyopenssl/issues/974
92     "test_verify_with_time"
93   ];
95   meta = with lib; {
96     description = "Python wrapper around the OpenSSL library";
97     homepage = "https://github.com/pyca/pyopenssl";
98     changelog = "https://github.com/pyca/pyopenssl/blob/${version}/CHANGELOG.rst";
99     license = licenses.asl20;
100     maintainers = with maintainers; [ ];
101   };