1{ buildPythonPackage
2, isPyPy
3, fetchPypi
4, curl
5, openssl
6, bottle
7, pytest
8, nose
9, flaky
10}:
11
12buildPythonPackage rec {
13 pname = "pycurl";
14 version = "7.43.0.5";
15 disabled = isPyPy; # https://github.com/pycurl/pycurl/issues/208
16
17 src = fetchPypi {
18 inherit pname version;
19 sha256 = "ec7dd291545842295b7b56c12c90ffad2976cc7070c98d7b1517b7b6cd5994b3";
20 };
21
22 buildInputs = [
23 curl
24 openssl.out
25 ];
26
27 nativeBuildInputs = [
28 curl
29 ];
30
31 checkInputs = [
32 bottle
33 pytest
34 nose
35 flaky
36 ];
37
38 # skip impure or flakey tests
39 # See also:
40 # * https://github.com/NixOS/nixpkgs/issues/77304
41 checkPhase = ''
42 HOME=$TMPDIR pytest tests -k "not test_ssl_in_static_libs \
43 and not test_keyfunction \
44 and not test_keyfunction_bogus_return \
45 and not test_libcurl_ssl_gnutls \
46 and not test_libcurl_ssl_nss \
47 and not test_libcurl_ssl_openssl" \
48 --ignore=tests/getinfo_test.py \
49 --ignore=tests/memory_mgmt_test.py \
50 --ignore=tests/multi_memory_mgmt_test.py \
51 --ignore=tests/multi_timer_test.py
52 '';
53
54 preConfigure = ''
55 substituteInPlace setup.py --replace '--static-libs' '--libs'
56 export PYCURL_SSL_LIBRARY=openssl
57 '';
58
59 meta = {
60 homepage = "http://pycurl.sourceforge.net/";
61 description = "Python wrapper for libcurl";
62 };
63}