python3Packages.httpx: only unset $SSL_CERT_FILE if path doesn't exist (#530503)

This commit is contained in:
Arne Keller
2026-06-11 16:39:10 +00:00
committed by GitHub
3 changed files with 4 additions and 12 deletions
@@ -1,5 +1,7 @@
httpxSslCertFileUnset() {
if [ ! -e "${SSL_CERT_FILE-}" ]; then
unset SSL_CERT_FILE
fi
}
postHooks+=(httpxSslCertFileUnset)
@@ -43,6 +43,7 @@ buildPythonPackage (finalAttrs: {
pythonImportsCheck = [ "prowlpy" ];
nativeCheckInputs = [
cacert
pytest-asyncio
pytest-cov-stub
pytestCheckHook
@@ -50,12 +51,6 @@ buildPythonPackage (finalAttrs: {
]
++ lib.concatAttrValues finalAttrs.passthru.optional-dependencies;
preCheck = ''
# Without this pyreqwest fails with
# unexpected error: No CA certificates were loaded from the system
export SSL_CERT_FILE="${cacert}/etc/ssl/certs/ca-bundle.crt"
'';
# tests fail without this
pytestFlags = [ "-v" ];
@@ -43,6 +43,7 @@ buildPythonPackage (finalAttrs: {
pythonImportsCheck = [ "pyreqwest" ];
nativeCheckInputs = [
cacert
dirty-equals
docker
granian
@@ -57,12 +58,6 @@ buildPythonPackage (finalAttrs: {
yarl
];
preCheck = ''
# Without this tests fails with
# unexpected error: No CA certificates were loaded from the system
export SSL_CERT_FILE="${cacert}/etc/ssl/certs/ca-bundle.crt"
'';
disabledTestPaths = [
# requires a running Docker daemon
"tests/test_examples.py"