nixpkgs/pkgs/development/python-modules/httplib2/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

75 lines
1.4 KiB
Nix
Raw Normal View History

python3Packages.httplib2: allow local networking on darwin There is just one test failure on darwin, and it can probably be worked around by allowing local networking. This should hopefully fix the following testsuite error: ``` ___________________________ test_timeout_subsequent ____________________________ tests/test_other.py:137: in test_timeout_subsequent assert response.status == 200 E assert 408 == 200 E +408 E -200 Handler = <class 'tests.test_other.test_timeout_subsequent.<locals>.Handler'> _ = b'Request Timeout' http = <httplib2.Http object at 0x10860f400> response = {'content-type': 'text/plain', 'status': '408', 'content-length': 15} uri = 'http://localhost:58287/' ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "/private/tmp/nix-build-python3.8-httplib2-0.19.1.drv-0/source/tests/__init__.py", line 311, in server_socket_thread fun(client, tick) File "/private/tmp/nix-build-python3.8-httplib2-0.19.1.drv-0/source/tests/__init__.py", line 392, in server_request_socket_handler request = HttpRequest.from_buffered(buf) File "/private/tmp/nix-build-python3.8-httplib2-0.19.1.drv-0/source/tests/__init__.py", line 177, in from_buffered return parse_http_message(cls, buf) File "/private/tmp/nix-build-python3.8-httplib2-0.19.1.drv-0/source/tests/__init__.py", line 120, in parse_http_message start_line = buf.readline() File "/private/tmp/nix-build-python3.8-httplib2-0.19.1.drv-0/source/tests/__init__.py", line 110, in readline self._fill(more=1) File "/private/tmp/nix-build-python3.8-httplib2-0.19.1.drv-0/source/tests/__init__.py", line 81, in _fill chunk = self._sock.recv(8 << 10) ConnectionResetError: [Errno 54] Connection reset by peer ```
2021-04-22 11:22:56 +00:00
{ lib
, stdenv
, buildPythonPackage
, cryptography
2021-02-13 17:45:46 +00:00
, fetchFromGitHub
, isPy27
, mock
, pyparsing
2021-02-13 17:45:46 +00:00
, pytest-forked
, pytest-randomly
, pytest-timeout
, pytest-xdist
, pytestCheckHook
, six
}:
2018-05-01 11:24:41 +00:00
buildPythonPackage rec {
pname = "httplib2";
version = "0.20.3";
format = "setuptools";
2018-05-01 11:24:41 +00:00
2021-02-13 17:45:46 +00:00
src = fetchFromGitHub {
owner = pname;
repo = pname;
rev = "v${version}";
sha256 = "sha256-Q5KkhVqyHDoIeKjvvYoHRbZPY7LUXGDwgp4CSuyvQ1g=";
2018-05-01 11:24:41 +00:00
};
propagatedBuildInputs = [
pyparsing
];
python3Packages.httplib2: allow local networking on darwin There is just one test failure on darwin, and it can probably be worked around by allowing local networking. This should hopefully fix the following testsuite error: ``` ___________________________ test_timeout_subsequent ____________________________ tests/test_other.py:137: in test_timeout_subsequent assert response.status == 200 E assert 408 == 200 E +408 E -200 Handler = <class 'tests.test_other.test_timeout_subsequent.<locals>.Handler'> _ = b'Request Timeout' http = <httplib2.Http object at 0x10860f400> response = {'content-type': 'text/plain', 'status': '408', 'content-length': 15} uri = 'http://localhost:58287/' ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "/private/tmp/nix-build-python3.8-httplib2-0.19.1.drv-0/source/tests/__init__.py", line 311, in server_socket_thread fun(client, tick) File "/private/tmp/nix-build-python3.8-httplib2-0.19.1.drv-0/source/tests/__init__.py", line 392, in server_request_socket_handler request = HttpRequest.from_buffered(buf) File "/private/tmp/nix-build-python3.8-httplib2-0.19.1.drv-0/source/tests/__init__.py", line 177, in from_buffered return parse_http_message(cls, buf) File "/private/tmp/nix-build-python3.8-httplib2-0.19.1.drv-0/source/tests/__init__.py", line 120, in parse_http_message start_line = buf.readline() File "/private/tmp/nix-build-python3.8-httplib2-0.19.1.drv-0/source/tests/__init__.py", line 110, in readline self._fill(more=1) File "/private/tmp/nix-build-python3.8-httplib2-0.19.1.drv-0/source/tests/__init__.py", line 81, in _fill chunk = self._sock.recv(8 << 10) ConnectionResetError: [Errno 54] Connection reset by peer ```
2021-04-22 11:22:56 +00:00
2021-02-13 17:45:46 +00:00
checkInputs = [
cryptography
2021-02-13 17:45:46 +00:00
mock
pytest-forked
pytest-randomly
pytest-timeout
pytest-xdist
six
pytestCheckHook
];
# Don't run tests for Python 2.7
doCheck = !isPy27;
postPatch = ''
sed -i "/--cov/d" setup.cfg
'';
disabledTests = [
# ValueError: Unable to load PEM file.
# https://github.com/httplib2/httplib2/issues/192#issuecomment-993165140
"test_client_cert_password_verified"
] ++ lib.optionals (stdenv.isDarwin) [
# fails with HTTP 408 Request Timeout, instead of expected 200 OK
"test_timeout_subsequent"
];
python3Packages.httplib2: allow local networking on darwin There is just one test failure on darwin, and it can probably be worked around by allowing local networking. This should hopefully fix the following testsuite error: ``` ___________________________ test_timeout_subsequent ____________________________ tests/test_other.py:137: in test_timeout_subsequent assert response.status == 200 E assert 408 == 200 E +408 E -200 Handler = <class 'tests.test_other.test_timeout_subsequent.<locals>.Handler'> _ = b'Request Timeout' http = <httplib2.Http object at 0x10860f400> response = {'content-type': 'text/plain', 'status': '408', 'content-length': 15} uri = 'http://localhost:58287/' ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "/private/tmp/nix-build-python3.8-httplib2-0.19.1.drv-0/source/tests/__init__.py", line 311, in server_socket_thread fun(client, tick) File "/private/tmp/nix-build-python3.8-httplib2-0.19.1.drv-0/source/tests/__init__.py", line 392, in server_request_socket_handler request = HttpRequest.from_buffered(buf) File "/private/tmp/nix-build-python3.8-httplib2-0.19.1.drv-0/source/tests/__init__.py", line 177, in from_buffered return parse_http_message(cls, buf) File "/private/tmp/nix-build-python3.8-httplib2-0.19.1.drv-0/source/tests/__init__.py", line 120, in parse_http_message start_line = buf.readline() File "/private/tmp/nix-build-python3.8-httplib2-0.19.1.drv-0/source/tests/__init__.py", line 110, in readline self._fill(more=1) File "/private/tmp/nix-build-python3.8-httplib2-0.19.1.drv-0/source/tests/__init__.py", line 81, in _fill chunk = self._sock.recv(8 << 10) ConnectionResetError: [Errno 54] Connection reset by peer ```
2021-04-22 11:22:56 +00:00
pytestFlagsArray = [
"--ignore python2"
];
pythonImportsCheck = [
"httplib2"
];
2019-02-14 07:37:17 +00:00
2018-05-01 11:24:41 +00:00
meta = with lib; {
description = "A comprehensive HTTP client library";
homepage = "https://github.com/httplib2/httplib2";
2018-05-01 11:24:41 +00:00
license = licenses.mit;
2021-02-13 17:45:46 +00:00
maintainers = with maintainers; [ fab ];
2018-05-01 11:24:41 +00:00
};
}