2021-04-26 19:14:03 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2021-03-09 03:18:52 +00:00
|
|
|
, buildPythonPackage
|
2021-12-26 17:43:05 +00:00
|
|
|
, cryptography
|
2021-03-09 03:18:52 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, isPy27
|
|
|
|
, mock
|
|
|
|
, pyparsing
|
|
|
|
, pytest-forked
|
|
|
|
, pytest-randomly
|
|
|
|
, pytest-timeout
|
|
|
|
, pytest-xdist
|
|
|
|
, pytestCheckHook
|
|
|
|
, six
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "httplib2";
|
2021-12-26 17:43:05 +00:00
|
|
|
version = "0.20.3";
|
|
|
|
format = "setuptools";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = pname;
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-12-26 17:43:05 +00:00
|
|
|
sha256 = "sha256-Q5KkhVqyHDoIeKjvvYoHRbZPY7LUXGDwgp4CSuyvQ1g=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-12-26 17:43:05 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
pyparsing
|
|
|
|
];
|
2021-04-26 19:14:03 +00:00
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
checkInputs = [
|
2021-12-26 17:43:05 +00:00
|
|
|
cryptography
|
2021-03-09 03:18:52 +00:00
|
|
|
mock
|
|
|
|
pytest-forked
|
|
|
|
pytest-randomly
|
|
|
|
pytest-timeout
|
|
|
|
pytest-xdist
|
|
|
|
six
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
2021-12-26 17:43:05 +00:00
|
|
|
# Don't run tests for Python 2.7
|
|
|
|
doCheck = !isPy27;
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
sed -i "/--cov/d" setup.cfg
|
|
|
|
'';
|
|
|
|
|
2022-01-13 20:06:32 +00:00
|
|
|
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) [
|
2021-04-26 19:14:03 +00:00
|
|
|
# fails with HTTP 408 Request Timeout, instead of expected 200 OK
|
|
|
|
"test_timeout_subsequent"
|
2022-03-30 09:31:56 +00:00
|
|
|
"test_connection_close"
|
2021-04-26 19:14:03 +00:00
|
|
|
];
|
|
|
|
|
2021-12-26 17:43:05 +00:00
|
|
|
pytestFlagsArray = [
|
|
|
|
"--ignore python2"
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"httplib2"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A comprehensive HTTP client library";
|
2021-12-26 17:43:05 +00:00
|
|
|
homepage = "https://github.com/httplib2/httplib2";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mit;
|
2021-03-09 03:18:52 +00:00
|
|
|
maintainers = with maintainers; [ fab ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|