python3Packages.typing-extensions: 3.10.0.2 -> 4.0.1

This commit is contained in:
Fabian Affolter 2022-01-03 23:23:21 +01:00
parent 2a0966e816
commit 580d3db631

View File

@ -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";