at master 1.6 kB view raw
1{ 2 lib, 3 astor, 4 buildPythonPackage, 5 fetchFromGitHub, 6 funcparserlib, 7 hy, 8 pytestCheckHook, 9 python, 10 pythonOlder, 11 setuptools, 12 testers, 13}: 14 15buildPythonPackage rec { 16 pname = "hy"; 17 version = "1.1.0"; 18 pyproject = true; 19 20 src = fetchFromGitHub { 21 owner = "hylang"; 22 repo = "hy"; 23 tag = version; 24 hash = "sha256-zaTe9sRmW+lzpbNVrnj5ccp1xIbN10FD1Jst/hM78Lw="; 25 }; 26 27 # https://github.com/hylang/hy/blob/1.0a4/get_version.py#L9-L10 28 HY_VERSION = version; 29 30 build-system = [ setuptools ]; 31 32 dependencies = [ funcparserlib ]; 33 34 nativeCheckInputs = [ pytestCheckHook ]; 35 36 preCheck = '' 37 # For test_bin_hy 38 export PATH="$out/bin:$PATH" 39 ''; 40 41 pythonImportsCheck = [ "hy" ]; 42 43 passthru = { 44 tests.version = testers.testVersion { 45 package = hy; 46 command = "hy -v"; 47 }; 48 # For backwards compatibility with removed pkgs/development/interpreters/hy 49 # Example usage: 50 # hy.withPackages (ps: with ps; [ hyrule requests ]) 51 withPackages = 52 python-packages: 53 (python.withPackages (ps: (python-packages ps) ++ [ ps.hy ])).overrideAttrs (old: { 54 name = "${hy.name}-env"; 55 meta = lib.mergeAttrs (builtins.removeAttrs hy.meta [ "license" ]) { mainProgram = "hy"; }; 56 }); 57 }; 58 59 meta = with lib; { 60 description = "LISP dialect embedded in Python"; 61 homepage = "https://hylang.org/"; 62 changelog = "https://github.com/hylang/hy/releases/tag/${src.tag}"; 63 license = licenses.mit; 64 maintainers = with maintainers; [ 65 mazurel 66 nixy 67 ]; 68 }; 69}