nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, astor
3, buildPythonPackage
4, colorama
5, fetchFromGitHub
6, funcparserlib
7, hy
8, pytestCheckHook
9, python
10, pythonOlder
11, rply
12, testers
13, toPythonApplication
14, hyDefinedPythonPackages ? python-packages: [ ] /* Packages like with python.withPackages */
15}:
16
17buildPythonPackage rec {
18 pname = "hy";
19 version = "1.0a4";
20 format = "setuptools";
21
22 disabled = pythonOlder "3.7";
23
24 src = fetchFromGitHub {
25 owner = "hylang";
26 repo = pname;
27 rev = version;
28 sha256 = "sha256-MBzp3jqBg/kH233wcgYYHc+Yg9GuOaBsXIfjFDihD1E=";
29 };
30
31 # https://github.com/hylang/hy/blob/1.0a4/get_version.py#L9-L10
32 HY_VERSION = version;
33
34 propagatedBuildInputs = [
35 colorama
36 funcparserlib
37 rply # TODO: remove on the next release
38 ]
39 ++ lib.optionals (pythonOlder "3.9") [
40 astor
41 ]
42 # for backwards compatibility with removed pkgs/development/interpreters/hy
43 # See: https://github.com/NixOS/nixpkgs/issues/171428
44 ++ (hyDefinedPythonPackages python.pkgs);
45
46 checkInputs = [
47 pytestCheckHook
48 ];
49
50 disabledTests = [
51 # Don't test the binary
52 "test_bin_hy"
53 "test_hystartup"
54 "est_hy2py_import"
55 ];
56
57 pythonImportsCheck = [ "hy" ];
58
59 passthru = {
60 tests.version = testers.testVersion {
61 package = hy;
62 command = "hy -v";
63 };
64 # also for backwards compatibility with removed pkgs/development/interpreters/hy
65 withPackages = python-packages: (toPythonApplication hy).override {
66 hyDefinedPythonPackages = python-packages;
67 };
68 };
69
70 meta = with lib; {
71 description = "A LISP dialect embedded in Python";
72 homepage = "https://hylang.org/";
73 changelog = "https://github.com/hylang/hy/releases/tag/${version}";
74 license = licenses.mit;
75 maintainers = with maintainers; [ fab mazurel nixy thiagokokada ];
76 };
77}