diff --git a/pkgs/development/python-modules/typing-extensions/default.nix b/pkgs/development/python-modules/typing-extensions/default.nix index 939ca25eb1a3..1e29bc9a6160 100644 --- a/pkgs/development/python-modules/typing-extensions/default.nix +++ b/pkgs/development/python-modules/typing-extensions/default.nix @@ -1,27 +1,41 @@ -{ lib, buildPythonPackage, fetchPypi, pythonOlder, isPy3k, python, typing }: -let - testDir = if isPy3k then "src_py3" else "src_py2"; +{ lib +, buildPythonPackage +, fetchPypi +, flit-core +, python +, pythonOlder +}: -in buildPythonPackage rec { - pname = "typing_extensions"; - version = "3.10.0.2"; +buildPythonPackage rec { + pname = "typing-extensions"; + version = "4.0.1"; + format = "pyproject"; + + disabled = pythonOlder "3.6"; src = fetchPypi { - inherit pname version; - sha256 = "49f75d16ff11f1cd258e1b988ccff82a3ca5570217d7ad8c5f48205dd99a677e"; + pname = "typing_extensions"; + inherit version; + hash = "sha256-TKCR3qFJ+UXsVq+0ja5xTyHoaS7yKjlSI7zTKJYbag4="; }; - checkInputs = lib.optional (pythonOlder "3.5") typing; + nativeBuildInputs = [ + flit-core + ]; - # Error for Python3.6: ImportError: cannot import name 'ann_module' - # See https://github.com/python/typing/pull/280 - doCheck = pythonOlder "3.6"; - - checkPhase = '' - cd ${testDir} - ${python.interpreter} -m unittest discover + postPatch = '' + # Remove metadata for README which are outdated + sed -i -e '11,24d' pyproject.toml ''; + # Tests are not part of PyPI releases. GitHub source can't be used + # as it ends with an infinite recursion + doCheck = false; + + pythonImportsCheck = [ + "typing_extensions" + ]; + meta = with lib; { description = "Backported and Experimental Type Hints for Python 3.5+"; homepage = "https://github.com/python/typing";