Skip to content

Commit

Permalink
Merge pull request #175422 from SuperSandro2000/urllib3
Browse files Browse the repository at this point in the history
python310Packages.urllib3: add optional-dependencies
  • Loading branch information
SuperSandro2000 authored Jun 2, 2022
2 parents 08dc103 + 1704d3a commit a8ede41
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 a8ede41

Please sign in to comment.