Skip to content

Commit

Permalink
python310Packages.urllib3: add optional-dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperSandro2000 committed May 30, 2022
1 parent 1b36442 commit 1704d3a
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions pkgs/development/python-modules/urllib3/default.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{ lib
, brotli
, brotlicffi
, buildPythonPackage
, certifi
, cryptography
, python-dateutil
, fetchPypi
, isPyPy
, idna
, isPy27
, mock
, pyopenssl
, pysocks
Expand All @@ -26,14 +28,9 @@ buildPythonPackage rec {
hash = "sha256-qrrxZHeAal4d0ZqkH4wreVDdPHRjYtfjIj2+beasRI4=";
};

propagatedBuildInputs = [
brotli
pysocks
] ++ lib.optionals isPy27 [
cryptography
idna
pyopenssl
];
# FIXME: remove backwards compatbility hack
propagatedBuildInputs = passthru.optional-dependencies.brotli
++ passthru.optional-dependencies.secure;

checkInputs = [
python-dateutil
Expand Down Expand Up @@ -66,6 +63,12 @@ buildPythonPackage rec {
"urllib3"
];

passthru.optional-dependencies = {
brotli = if isPyPy then [ brotlicffi ] else [ brotli ];
secure = [ certifi cryptography idna pyopenssl ];
socks = [ pysocks ];
};

meta = with lib; {
description = "Powerful, sanity-friendly HTTP client for Python";
homepage = "https://github.com/shazow/urllib3";
Expand Down

0 comments on commit 1704d3a

Please sign in to comment.