Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at 21.05 33 lines 913 B view raw
1{ lib, buildPythonPackage, fetchPypi, pythonOlder, isPy3k, isPyPy, python 2, pythonAtLeast }: 3 4let 5 testDir = if isPy3k then "src" else "python2"; 6 7in buildPythonPackage rec { 8 pname = "typing"; 9 version = "3.7.4.3"; 10 11 src = fetchPypi { 12 inherit pname version; 13 sha256 = "1187fb9c82fd670d10aa07bbb6cfcfe4bdda42d6fab8d5134f04e8c4d0b71cc9"; 14 }; 15 16 disabled = pythonAtLeast "3.5"; 17 18 # Error for Python3.6: ImportError: cannot import name 'ann_module' 19 # See https://github.com/python/typing/pull/280 20 # Also, don't bother on PyPy: AssertionError: TypeError not raised 21 doCheck = pythonOlder "3.6" && !isPyPy; 22 23 checkPhase = '' 24 cd ${testDir} 25 ${python.interpreter} -m unittest discover 26 ''; 27 28 meta = with lib; { 29 description = "Backport of typing module to Python versions older than 3.5"; 30 homepage = "https://docs.python.org/3/library/typing.html"; 31 license = licenses.psfl; 32 }; 33}