diff options
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/urllib3/default.nix')
-rw-r--r-- | nixpkgs/pkgs/development/python-modules/urllib3/default.nix | 66 |
1 files changed, 53 insertions, 13 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/urllib3/default.nix b/nixpkgs/pkgs/development/python-modules/urllib3/default.nix index 6cf7ce34d388..b7a3f81c723f 100644 --- a/nixpkgs/pkgs/development/python-modules/urllib3/default.nix +++ b/nixpkgs/pkgs/development/python-modules/urllib3/default.nix @@ -1,33 +1,73 @@ -{ lib, buildPythonPackage, fetchPypi -, pytest, mock, tornado, pyopenssl, cryptography -, idna, certifi, ipaddress, pysocks }: +{ lib +, brotli +, buildPythonPackage +, cryptography +, dateutil +, fetchPypi +, idna +, isPy27 +, mock +, pyopenssl +, pysocks +, pytest-freezegun +, pytest-timeout +, pytestCheckHook +, pythonOlder +, tornado +, trustme +}: buildPythonPackage rec { pname = "urllib3"; - version = "1.26.2"; + version = "1.26.3"; src = fetchPypi { inherit pname version; - sha256 = "19188f96923873c92ccb987120ec4acaa12f0461fa9ce5d3d0772bc965a39e08"; + sha256 = "de3eedaad74a2683334e282005cd8d7f22f4d55fa690a2a1020a416cb0a47e73"; }; - NOSE_EXCLUDE = lib.concatStringsSep "," [ - "test_headers" "test_headerdict" "test_can_validate_ip_san" "test_delayed_body_read_timeout" - "test_timeout_errors_cause_retries" "test_select_multiple_interrupts_with_event" + propagatedBuildInputs = [ + brotli + pysocks + ] ++ lib.optionals isPy27 [ + cryptography + idna + pyopenssl ]; - checkPhase = '' - nosetests -v --cover-min-percentage 1 - ''; + checkInputs = [ + dateutil + mock + pytest-freezegun + pytest-timeout + pytestCheckHook + tornado + trustme + ]; + # 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; - checkInputs = [ pytest mock tornado ]; - propagatedBuildInputs = [ pyopenssl cryptography idna certifi ipaddress pysocks ]; + preCheck = '' + export CI # Increases LONG_TIMEOUT + ''; + + pythonImportsCheck = [ "urllib3" ]; meta = with lib; { description = "Powerful, sanity-friendly HTTP client for Python"; homepage = "https://github.com/shazow/urllib3"; license = licenses.mit; + maintainers = with maintainers; [ fab ]; }; } |