depot/third_party/nixpkgs/pkgs/development/python-modules/urllib3/default.nix
Default email 13da32182d Project import generated by Copybara.
GitOrigin-RevId: a7855f2235a1876f97473a76151fec2afa02b287
2022-08-21 15:32:41 +02:00

79 lines
1.8 KiB
Nix

{ lib
, brotli
, brotlicffi
, buildPythonPackage
, certifi
, cryptography
, fetchPypi
, idna
, isPyPy
, mock
, pyopenssl
, pysocks
, pytest-freezegun
, pytest-timeout
, pytestCheckHook
, python-dateutil
, tornado
, trustme
}:
buildPythonPackage rec {
pname = "urllib3";
version = "1.26.11";
format = "setuptools";
src = fetchPypi {
inherit pname version;
hash = "sha256-6m6PshCxnZUPq5O2DJAJImxjoogIvIOG4FMB4liDrAo=";
};
# FIXME: remove backwards compatbility hack
propagatedBuildInputs = passthru.optional-dependencies.brotli
++ passthru.optional-dependencies.socks;
checkInputs = [
python-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;
preCheck = ''
export CI # Increases LONG_TIMEOUT
'';
pythonImportsCheck = [
"urllib3"
];
passthru.optional-dependencies = {
brotli = if isPyPy then [ brotlicffi ] else [ brotli ];
# Use carefully since pyopenssl is not supported aarch64-darwin
secure = [ certifi cryptography idna pyopenssl ];
socks = [ pysocks ];
};
meta = with lib; {
description = "Powerful, sanity-friendly HTTP client for Python";
homepage = "https://github.com/shazow/urllib3";
license = licenses.mit;
maintainers = with maintainers; [ fab ];
};
}