1{ lib, buildPythonPackage, fetchPypi, pythonOlder, isPy3k, python }: 2 3let 4 testDir = if isPy3k then "src" else "python2"; 5 6in buildPythonPackage rec { 7 pname = "typing"; 8 version = "3.6.6"; 9 10 src = fetchPypi { 11 inherit pname version; 12 sha256 = "4027c5f6127a6267a435201981ba156de91ad0d1d98e9ddc2aa173453453492d"; 13 }; 14 15 # Error for Python3.6: ImportError: cannot import name 'ann_module' 16 # See https://github.com/python/typing/pull/280 17 doCheck = pythonOlder "3.6"; 18 19 checkPhase = '' 20 cd ${testDir} 21 ${python.interpreter} -m unittest discover 22 ''; 23 24 meta = with lib; { 25 description = "Backport of typing module to Python versions older than 3.5"; 26 homepage = https://docs.python.org/3/library/typing.html; 27 license = licenses.psfl; 28 }; 29}