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
|
|
|
|
'';
|
|
|
|
|
2021-04-26 19:14:03 +00:00
|
|
|
disabledTests = lib.optionals (stdenv.isDarwin) [
|
|
|
|
# fails with HTTP 408 Request Timeout, instead of expected 200 OK
|
|
|
|
"test_timeout_subsequent"
|
|
|
|
];
|
|
|
|
|
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
|
|
|
};
|
|
|
|
}
|