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
commit 0a8d07eef1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 4 additions and 12 deletions

View file

@ -1,5 +1,7 @@
httpxSslCertFileUnset() {
if [ ! -e "${SSL_CERT_FILE-}" ]; then
unset SSL_CERT_FILE
fi
}
postHooks+=(httpxSslCertFileUnset)

View file

@ -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" ];

View file

@ -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"