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
|
|
|
|
, pytestCheckHook
|
2023-07-15 17:15:38 +00:00
|
|
|
, pythonAtLeast
|
2021-03-09 03:18:52 +00:00
|
|
|
, six
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "httplib2";
|
2022-12-17 10:02:37 +00:00
|
|
|
version = "0.21.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}";
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-1Pl+l28J7crfO2UY/9/D019IzOHWOwjR+UvVEHICTqU=";
|
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
|
|
|
|
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-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
|
|
|
|
|
|
|
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"
|
2022-04-15 01:41:22 +00:00
|
|
|
|
|
|
|
# improper pytest marking
|
|
|
|
"test_head_301"
|
|
|
|
"test_303"
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
# fails with "ConnectionResetError: [Errno 54] Connection reset by peer"
|
|
|
|
"test_connection_close"
|
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
|
|
|
};
|
|
|
|
}
|