2021-03-05 22:38:19 +00:00
|
|
|
{ lib
|
|
|
|
, brotli
|
|
|
|
, buildPythonPackage
|
|
|
|
, cryptography
|
|
|
|
, dateutil
|
|
|
|
, fetchPypi
|
|
|
|
, idna
|
2021-03-19 21:21:20 +00:00
|
|
|
, isPy27
|
2021-03-05 22:38:19 +00:00
|
|
|
, mock
|
|
|
|
, pyopenssl
|
|
|
|
, pysocks
|
|
|
|
, pytest-freezegun
|
|
|
|
, pytest-timeout
|
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
|
|
|
, tornado
|
|
|
|
, trustme
|
|
|
|
}:
|
2017-09-05 10:16:41 +01:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "urllib3";
|
2021-03-28 15:20:42 +01:00
|
|
|
version = "1.26.4";
|
2017-09-05 10:16:41 +01:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-03-28 15:20:42 +01:00
|
|
|
sha256 = "0dw9w9bs3hmr5dp3r3h43jyzzb1g1046ag7lj8pqf58i4kvj3c77";
|
2017-09-05 10:16:41 +01:00
|
|
|
};
|
|
|
|
|
2021-03-05 22:38:19 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
brotli
|
2021-03-19 21:21:20 +00:00
|
|
|
pysocks
|
|
|
|
] ++ lib.optionals isPy27 [
|
2021-03-05 22:38:19 +00:00
|
|
|
cryptography
|
|
|
|
idna
|
|
|
|
pyopenssl
|
2017-09-05 10:16:41 +01:00
|
|
|
];
|
|
|
|
|
2021-03-05 22:38:19 +00:00
|
|
|
checkInputs = [
|
|
|
|
dateutil
|
|
|
|
mock
|
|
|
|
pytest-freezegun
|
|
|
|
pytest-timeout
|
|
|
|
pytestCheckHook
|
|
|
|
tornado
|
|
|
|
trustme
|
|
|
|
];
|
2017-09-05 10:16:41 +01:00
|
|
|
|
2021-03-14 08:10:25 +00:00
|
|
|
# Tests in urllib3 are mostly timeout-based instead of event-based and
|
|
|
|
# are therefore inherently flaky. On your own machine, the tests will
|
|
|
|
# typically build fine, but on a loaded cluster such as Hydra random
|
|
|
|
# timeouts will occur.
|
|
|
|
#
|
|
|
|
# The urllib3 test suite has two different timeouts in their test suite
|
|
|
|
# (see `test/__init__.py`):
|
|
|
|
# - SHORT_TIMEOUT
|
|
|
|
# - LONG_TIMEOUT
|
|
|
|
# When CI is in the env, LONG_TIMEOUT will be significantly increased.
|
|
|
|
# Still, failures can occur and for that reason tests are disabled.
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
export CI # Increases LONG_TIMEOUT
|
|
|
|
'';
|
2021-03-13 09:44:31 +00:00
|
|
|
|
2021-03-05 22:38:19 +00:00
|
|
|
pythonImportsCheck = [ "urllib3" ];
|
2017-09-05 10:16:41 +01:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2017-09-05 10:04:42 +01:00
|
|
|
description = "Powerful, sanity-friendly HTTP client for Python";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/shazow/urllib3";
|
2017-09-05 10:16:41 +01:00
|
|
|
license = licenses.mit;
|
2021-03-05 22:38:19 +00:00
|
|
|
maintainers = with maintainers; [ fab ];
|
2017-09-05 10:16:41 +01:00
|
|
|
};
|
|
|
|
}
|