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.4";
9
10 src = fetchPypi {
11 inherit pname version;
12 sha256 = "d400a9344254803a2368533e4533a4200d21eb7b6b729c173bc38201a74db3f2";
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}