python3Packages.pycurl: disable failing tests (#122950)

and clean up and refactor the package.
This commit is contained in:
Martin Weinelt 2021-05-14 15:20:29 +02:00 committed by GitHub
parent bfb5f4cc5e
commit 803a16442d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,11 +1,12 @@
{ buildPythonPackage { lib
, buildPythonPackage
, isPyPy , isPyPy
, fetchPypi , fetchPypi
, pythonOlder , pythonOlder
, curl , curl
, openssl , openssl
, bottle , bottle
, pytest , pytestCheckHook
, nose , nose
, flaky , flaky
}: }:
@ -20,6 +21,11 @@ buildPythonPackage rec {
sha256 = "8301518689daefa53726b59ded6b48f33751c383cf987b0ccfbbc4ed40281325"; sha256 = "8301518689daefa53726b59ded6b48f33751c383cf987b0ccfbbc4ed40281325";
}; };
preConfigure = ''
substituteInPlace setup.py --replace '--static-libs' '--libs'
export PYCURL_SSL_LIBRARY=openssl
'';
buildInputs = [ buildInputs = [
curl curl
openssl.out openssl.out
@ -31,34 +37,48 @@ buildPythonPackage rec {
checkInputs = [ checkInputs = [
bottle bottle
pytest pytestCheckHook
nose nose
flaky flaky
]; ];
# skip impure or flakey tests pytestFlagsArray = [
# See also: # don't pick up the tests directory below examples/
# * https://github.com/NixOS/nixpkgs/issues/77304 "tests"
checkPhase = '' ];
HOME=$TMPDIR pytest tests -k "not test_ssl_in_static_libs \
and not test_keyfunction \ preCheck = ''
and not test_keyfunction_bogus_return \ export HOME=$TMPDIR
and not test_libcurl_ssl_gnutls \
and not test_libcurl_ssl_nss \
and not test_libcurl_ssl_openssl" \
--ignore=tests/getinfo_test.py \
--ignore=tests/memory_mgmt_test.py \
--ignore=tests/multi_memory_mgmt_test.py \
--ignore=tests/multi_timer_test.py
''; '';
preConfigure = '' disabledTests = [
substituteInPlace setup.py --replace '--static-libs' '--libs' # libcurl stopped passing the reason phrase from the HTTP status line
export PYCURL_SSL_LIBRARY=openssl # https://github.com/pycurl/pycurl/issues/679
''; "test_failonerror"
"test_failonerror_status_line_invalid_utf8_python3"
# bottle>=0.12.17 escapes utf8 properly, so these test don't work anymore
# https://github.com/pycurl/pycurl/issues/669
"test_getinfo_content_type_invalid_utf8_python3"
"test_getinfo_cookie_invalid_utf8_python3"
"test_getinfo_raw_content_type_invalid_utf8"
"test_getinfo_raw_cookie_invalid_utf8"
# tests that require network access
"test_keyfunction"
"test_keyfunction_bogus_return"
# OSError: tests/fake-curl/libcurl/with_openssl.so: cannot open shared object file: No such file or directory
"test_libcurl_ssl_openssl"
# OSError: tests/fake-curl/libcurl/with_nss.so: cannot open shared object file: No such file or directory
"test_libcurl_ssl_nss"
# OSError: tests/fake-curl/libcurl/with_gnutls.so: cannot open shared object file: No such file or directory
"test_libcurl_ssl_gnutls"
# AssertionError: assert 'crypto' in ['curl']
"test_ssl_in_static_libs"
];
meta = { meta = with lib; {
homepage = "http://pycurl.sourceforge.net/"; homepage = "http://pycurl.sourceforge.net/";
description = "Python wrapper for libcurl"; description = "Python wrapper for libcurl";
license = licenses.lgpl2Only;
maintainers = with maintainers; [];
}; };
} }