summary refs log tree commit diff
path: root/pkgs/development/python-modules/hy/default.nix
blob: a962f86854f2a6e33354856f85b449190fd8260a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
{ lib
, astor
, buildPythonPackage
, colorama
, fetchFromGitHub
, funcparserlib
, hy
, pytestCheckHook
, python
, pythonOlder
, rply
, testers
, toPythonApplication
, hyDefinedPythonPackages ? python-packages: [ ] /* Packages like with python.withPackages */
}:

buildPythonPackage rec {
  pname = "hy";
  version = "1.0a4";
  format = "setuptools";

  disabled = pythonOlder "3.7";

  src = fetchFromGitHub {
    owner = "hylang";
    repo = pname;
    rev = version;
    sha256 = "sha256-MBzp3jqBg/kH233wcgYYHc+Yg9GuOaBsXIfjFDihD1E=";
  };

  # https://github.com/hylang/hy/blob/1.0a4/get_version.py#L9-L10
  HY_VERSION = version;

  propagatedBuildInputs = [
    colorama
    funcparserlib
    rply # TODO: remove on the next release
  ]
  ++ lib.optionals (pythonOlder "3.9") [
    astor
  ]
  # for backwards compatibility with removed pkgs/development/interpreters/hy
  # See: https://github.com/NixOS/nixpkgs/issues/171428
  ++ (hyDefinedPythonPackages python.pkgs);

  checkInputs = [
    pytestCheckHook
  ];

  disabledTests = [
    # Don't test the binary
    "test_bin_hy"
    "test_hystartup"
    "est_hy2py_import"
  ];

  pythonImportsCheck = [ "hy" ];

  passthru = {
    tests.version = testers.testVersion {
      package = hy;
      command = "hy -v";
    };
    # also for backwards compatibility with removed pkgs/development/interpreters/hy
    withPackages = python-packages: (toPythonApplication hy).override {
      hyDefinedPythonPackages = python-packages;
    };
  };

  meta = with lib; {
    description = "A LISP dialect embedded in Python";
    homepage = "https://hylang.org/";
    changelog = "https://github.com/hylang/hy/releases/tag/${version}";
    license = licenses.mit;
    maintainers = with maintainers; [ fab mazurel nixy thiagokokada ];
  };
}