python311Packages.urllib3: refactor

Changed files
+29 -32
pkgs
development
python-modules
urllib3
+29 -32
pkgs/development/python-modules/urllib3/default.nix
··· 1 { lib 2 , brotli 3 , brotlicffi 4 , buildPythonPackage ··· 8 , hatchling 9 , idna 10 , isPyPy 11 - , mock 12 , pyopenssl 13 , pysocks 14 - , pytest-freezegun 15 , pytest-timeout 16 , pytestCheckHook 17 - , python-dateutil 18 , tornado 19 , trustme 20 }: 21 22 - buildPythonPackage rec { 23 pname = "urllib3"; 24 version = "2.0.7"; 25 pyproject = true; ··· 33 hatchling 34 ]; 35 36 - # FIXME: remove backwards compatbility hack 37 - propagatedBuildInputs = passthru.optional-dependencies.brotli 38 - ++ passthru.optional-dependencies.socks; 39 40 nativeCheckInputs = [ 41 - python-dateutil 42 - mock 43 - pytest-freezegun 44 pytest-timeout 45 pytestCheckHook 46 tornado 47 trustme 48 - ]; 49 50 # Tests in urllib3 are mostly timeout-based instead of event-based and 51 # are therefore inherently flaky. On your own machine, the tests will ··· 60 # Still, failures can occur and for that reason tests are disabled. 61 doCheck = false; 62 63 preCheck = '' 64 export CI # Increases LONG_TIMEOUT 65 ''; ··· 68 "urllib3" 69 ]; 70 71 - passthru.optional-dependencies = { 72 - brotli = if isPyPy then [ 73 - brotlicffi 74 - ] else [ 75 - brotli 76 - ]; 77 - # Use carefully since pyopenssl is not supported aarch64-darwin 78 - secure = [ 79 - certifi 80 - cryptography 81 - idna 82 - pyopenssl 83 - ]; 84 - socks = [ 85 - pysocks 86 - ]; 87 - }; 88 - 89 meta = with lib; { 90 - description = "Powerful, sanity-friendly HTTP client for Python"; 91 - homepage = "https://github.com/shazow/urllib3"; 92 changelog = "https://github.com/urllib3/urllib3/blob/${version}/CHANGES.rst"; 93 license = licenses.mit; 94 maintainers = with maintainers; [ fab ]; 95 }; 96 - }
··· 1 { lib 2 + , backports-zoneinfo 3 , brotli 4 , brotlicffi 5 , buildPythonPackage ··· 9 , hatchling 10 , idna 11 , isPyPy 12 , pyopenssl 13 , pysocks 14 , pytest-timeout 15 , pytestCheckHook 16 + , pythonOlder 17 , tornado 18 , trustme 19 }: 20 21 + let self = buildPythonPackage rec { 22 pname = "urllib3"; 23 version = "2.0.7"; 24 pyproject = true; ··· 32 hatchling 33 ]; 34 35 + passthru.optional-dependencies = { 36 + brotli = if isPyPy then [ 37 + brotlicffi 38 + ] else [ 39 + brotli 40 + ]; 41 + # Use carefully since pyopenssl is not supported aarch64-darwin 42 + secure = [ 43 + certifi 44 + cryptography 45 + idna 46 + pyopenssl 47 + ]; 48 + socks = [ 49 + pysocks 50 + ]; 51 + }; 52 53 nativeCheckInputs = [ 54 pytest-timeout 55 pytestCheckHook 56 tornado 57 trustme 58 + ] ++ lib.optionals (pythonOlder "3.9") [ 59 + backports-zoneinfo 60 + ] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies); 61 62 # Tests in urllib3 are mostly timeout-based instead of event-based and 63 # are therefore inherently flaky. On your own machine, the tests will ··· 72 # Still, failures can occur and for that reason tests are disabled. 73 doCheck = false; 74 75 + passthru.tests.pytest = self.overridePythonAttrs (_: { doCheck = true; }); 76 + 77 preCheck = '' 78 export CI # Increases LONG_TIMEOUT 79 ''; ··· 82 "urllib3" 83 ]; 84 85 meta = with lib; { 86 + description = "Powerful, user-friendly HTTP client for Python"; 87 + homepage = "https://github.com/urllib3/urllib3"; 88 changelog = "https://github.com/urllib3/urllib3/blob/${version}/CHANGES.rst"; 89 license = licenses.mit; 90 maintainers = with maintainers; [ fab ]; 91 }; 92 + }; 93 + in self