From 6264cc96173522c289f670c77e08b415f7be577b Mon Sep 17 00:00:00 2001 From: Ben Mares Date: Mon, 2 Dec 2024 22:46:07 +0100 Subject: [PATCH 1/2] Add upper bound for cryptography --- recipe/patch_yaml/pyopenssl.yaml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/recipe/patch_yaml/pyopenssl.yaml b/recipe/patch_yaml/pyopenssl.yaml index ea9f7f245..703d20cd0 100644 --- a/recipe/patch_yaml/pyopenssl.yaml +++ b/recipe/patch_yaml/pyopenssl.yaml @@ -17,3 +17,24 @@ then: - replace_depends: old: cryptography >=35.0 new: cryptography >=35.0,<39 +--- +# The above patch has the effect of encouraging the solver +# to prefer pyopenssl 21.0.0 instead of the latest version +# if there is a newer cryptography version available that is +# incompatible with all modern versions of pyopenssl. Thus +# we need to add upper bounds for all previous versions as +# well. +# The specific error I see with pyopenssl 21.0.0 and +# cryptography 44.0.0 is: +# .pixi/envs/default/lib/python3.12/site-packages/OpenSSL/crypto.py:1598: in X509StoreFlags +# NOTIFY_POLICY = _lib.X509_V_FLAG_NOTIFY_POLICY +# E AttributeError: module 'lib' has no attribute 'X509_V_FLAG_NOTIFY_POLICY'. Did you mean: 'X509_V_FLAG_EXPLICIT_POLICY'? +if: + name: pyopenssl + version_lt: "22.0.0" + timestamp_lt: 1733175687000 + has_depends: cryptography* +then: + - tighten_depends: + name: cryptography + upper_bound: "39" From 6b94aaca5efd5f818141515139ff14c6f6a5fae7 Mon Sep 17 00:00:00 2001 From: Ben Mares Date: Mon, 2 Dec 2024 23:05:30 +0100 Subject: [PATCH 2/2] lint --- recipe/patch_yaml/pyopenssl.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recipe/patch_yaml/pyopenssl.yaml b/recipe/patch_yaml/pyopenssl.yaml index 703d20cd0..4d96a748c 100644 --- a/recipe/patch_yaml/pyopenssl.yaml +++ b/recipe/patch_yaml/pyopenssl.yaml @@ -28,7 +28,8 @@ then: # cryptography 44.0.0 is: # .pixi/envs/default/lib/python3.12/site-packages/OpenSSL/crypto.py:1598: in X509StoreFlags # NOTIFY_POLICY = _lib.X509_V_FLAG_NOTIFY_POLICY -# E AttributeError: module 'lib' has no attribute 'X509_V_FLAG_NOTIFY_POLICY'. Did you mean: 'X509_V_FLAG_EXPLICIT_POLICY'? +# E AttributeError: module 'lib' has no attribute 'X509_V_FLAG_NOTIFY_POLICY'. +# Did you mean: 'X509_V_FLAG_EXPLICIT_POLICY'? if: name: pyopenssl version_lt: "22.0.0"