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