2021-03-19 17:17:44 +00:00
|
|
|
{ lib
|
|
|
|
, brotli
|
|
|
|
, buildPythonPackage
|
|
|
|
, cryptography
|
2021-07-04 02:40:35 +00:00
|
|
|
, python-dateutil
|
2021-03-19 17:17:44 +00:00
|
|
|
, fetchPypi
|
|
|
|
, idna
|
2021-04-05 15:23:46 +00:00
|
|
|
, isPy27
|
2021-03-19 17:17:44 +00:00
|
|
|
, mock
|
|
|
|
, pyopenssl
|
|
|
|
, pysocks
|
|
|
|
, pytest-freezegun
|
|
|
|
, pytest-timeout
|
|
|
|
, pytestCheckHook
|
|
|
|
, tornado
|
|
|
|
, trustme
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "urllib3";
|
2021-12-06 16:07:01 +00:00
|
|
|
version = "1.26.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-12-06 16:07:01 +00:00
|
|
|
sha256 = "sha256-SYfGVVT3otvzDBj9SHeO8SSvb6t3GjdxA9oFheIzbs4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-03-19 17:17:44 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
brotli
|
2021-04-05 15:23:46 +00:00
|
|
|
pysocks
|
|
|
|
] ++ lib.optionals isPy27 [
|
2021-03-19 17:17:44 +00:00
|
|
|
cryptography
|
|
|
|
idna
|
|
|
|
pyopenssl
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2021-03-19 17:17:44 +00:00
|
|
|
checkInputs = [
|
2021-07-04 02:40:35 +00:00
|
|
|
python-dateutil
|
2021-03-19 17:17:44 +00:00
|
|
|
mock
|
|
|
|
pytest-freezegun
|
|
|
|
pytest-timeout
|
|
|
|
pytestCheckHook
|
|
|
|
tornado
|
|
|
|
trustme
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-03-19 17:17:44 +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.
|
2020-04-24 23:36:52 +00:00
|
|
|
doCheck = false;
|
|
|
|
|
2021-03-19 17:17:44 +00:00
|
|
|
preCheck = ''
|
|
|
|
export CI # Increases LONG_TIMEOUT
|
|
|
|
'';
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "urllib3" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Powerful, sanity-friendly HTTP client for Python";
|
|
|
|
homepage = "https://github.com/shazow/urllib3";
|
|
|
|
license = licenses.mit;
|
2021-03-19 17:17:44 +00:00
|
|
|
maintainers = with maintainers; [ fab ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|