1{ lib 2, buildPythonPackage 3, fetchPypi 4, python 5, pythonAtLeast 6, pythonOlder 7, unittestCheckHook 8}: 9 10buildPythonPackage rec { 11 pname = "contextlib2"; 12 version = "21.6.0"; 13 format = "setuptools"; 14 15 # Python 3.11 not currently supported 16 # https://github.com/jazzband/contextlib2/issues/43 17 disabled = pythonOlder "3.6" || pythonAtLeast "3.11"; 18 19 src = fetchPypi { 20 inherit pname version; 21 hash = "sha256-qx4r/h0B2Wjht+jZAjvFHvNQm7ohe7cwzuOCfh7oKGk="; 22 }; 23 24 nativeCheckInputs = [ unittestCheckHook ]; 25 26 pythonImportsCheck = [ 27 "contextlib2" 28 ]; 29 30 meta = with lib; { 31 description = "Backports and enhancements for the contextlib module"; 32 homepage = "https://contextlib2.readthedocs.org/"; 33 license = licenses.psfl; 34 maintainers = with maintainers; [ ]; 35 }; 36}