Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / typed-ast / default.nix
blob48ce811b9ebecd42b4d2f4eacf533d3cf72bb632
1 { lib
2 , buildPythonPackage
3 , fetchFromGitHub
4 , pytest
5 , pythonOlder
6 }:
8 buildPythonPackage rec {
9   pname = "typed-ast";
10   version = "1.5.4";
11   format = "setuptools";
13   disabled = pythonOlder "3.6";
15   src = fetchFromGitHub {
16     owner = "python";
17     repo = "typed_ast";
18     rev = version;
19     hash = "sha256-GRmKw7SRrrIIb61VeB8GLhSKCmLUd54AA+GAf43vor8=";
20   };
22   nativeCheckInputs = [
23     pytest
24   ];
26   checkPhase = ''
27     runHook preCheck
29     # We can't use pytestCheckHook because that invokes pytest with python -m pytest
30     # which adds the current directory to sys.path at the beginning.
31     # _That_ version of the typed_ast module doesn't have the C extensions we need.
32     pytest
34     runHook postCheck
35   '';
37   pythonImportsCheck = [
38     "typed_ast"
39     "typed_ast.ast27"
40     "typed_ast.ast3"
41     "typed_ast.conversions"
42   ];
44   meta = with lib; {
45     description = "Python AST modules with type comment support";
46     homepage = "https://github.com/python/typed_ast";
47     license = licenses.asl20;
48     maintainers = with maintainers; [ ];
49   };