2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
buildPythonPackage,
|
|
|
|
cryptography,
|
|
|
|
fetchFromGitHub,
|
|
|
|
mock,
|
|
|
|
pyparsing,
|
|
|
|
pytest-forked,
|
|
|
|
pytest-randomly,
|
|
|
|
pytest-timeout,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonAtLeast,
|
|
|
|
six,
|
2021-03-09 03:18:52 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "httplib2";
|
2024-01-13 08:15:51 +00:00
|
|
|
version = "0.22.0";
|
2021-12-26 17:43:05 +00:00
|
|
|
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}";
|
2024-01-13 08:15:51 +00:00
|
|
|
hash = "sha256-76gdiRbF535CEaNXwNqsVeVc0dKglovMPQpGsOkbd/4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
postPatch = ''
|
|
|
|
sed -i "/--cov/d" setup.cfg
|
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
propagatedBuildInputs = [ pyparsing ];
|
2021-04-26 19:14:03 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-12-26 17:43:05 +00:00
|
|
|
cryptography
|
2021-03-09 03:18:52 +00:00
|
|
|
mock
|
|
|
|
pytest-forked
|
|
|
|
pytest-randomly
|
|
|
|
pytest-timeout
|
|
|
|
six
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
__darwinAllowLocalNetworking = true;
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
# Don't run tests for older Pythons
|
|
|
|
doCheck = pythonAtLeast "3.9";
|
2021-12-26 17:43:05 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
disabledTests =
|
|
|
|
[
|
|
|
|
# ValueError: Unable to load PEM file.
|
|
|
|
# https://github.com/httplib2/httplib2/issues/192#issuecomment-993165140
|
|
|
|
"test_client_cert_password_verified"
|
2022-04-15 01:41:22 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# improper pytest marking
|
|
|
|
"test_head_301"
|
|
|
|
"test_303"
|
|
|
|
]
|
2024-09-26 11:04:55 +00:00
|
|
|
++ lib.optionals stdenv.hostPlatform.isDarwin [
|
2024-06-05 15:53:02 +00:00
|
|
|
# fails with "ConnectionResetError: [Errno 54] Connection reset by peer"
|
|
|
|
"test_connection_close"
|
|
|
|
# fails with HTTP 408 Request Timeout, instead of expected 200 OK
|
|
|
|
"test_timeout_subsequent"
|
|
|
|
"test_connection_close"
|
|
|
|
];
|
2021-04-26 19:14:03 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pytestFlagsArray = [ "--ignore python2" ];
|
2021-12-26 17:43:05 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "httplib2" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "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
|
|
|
};
|
|
|
|
}
|