Files
nixpkgs/pkgs/development/python-modules/hy/default.nix
T
Thiago Kenji Okada 450d420811 hy: fix passthru.withPackages
In the previous version it was adding the extra packages as
`propagatedBuildInputs`. This meant that this package would be rebuild
for no reason (it is not like the package will actually depend on the
extra inputs) and also cause the strange side-effect of creating a hy
package without its console entry-points (e.g.: no `$out/bin` contents).

Now we are reusing the `python.withPackages` that will avoid the
unnecessary rebuild, fixing both issues.
2022-10-07 10:10:24 +01:00

75 lines
1.5 KiB
Nix

{ lib
, astor
, buildPythonPackage
, colorama
, fetchFromGitHub
, funcparserlib
, hy
, pytestCheckHook
, python
, pythonOlder
, rply
, testers
}:
buildPythonPackage rec {
pname = "hy";
version = "0.24.0";
format = "setuptools";
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "hylang";
repo = pname;
rev = version;
sha256 = "sha256-PmnYOniYqNHGTxpWuAc+zBhOsgRgMMbERHq81KpHheg=";
};
# https://github.com/hylang/hy/blob/1.0a4/get_version.py#L9-L10
HY_VERSION = version;
propagatedBuildInputs = [
colorama
funcparserlib
] ++
lib.optionals (pythonOlder "3.9") [
astor
];
checkInputs = [
pytestCheckHook
];
preCheck = ''
# For test_bin_hy
export PATH="$out/bin:$PATH"
'';
disabledTests = [
"test_circular_macro_require"
"test_macro_require"
];
pythonImportsCheck = [ "hy" ];
passthru = {
tests.version = testers.testVersion {
package = hy;
command = "hy -v";
};
# For backwards compatibility with removed pkgs/development/interpreters/hy
# Example usage:
# hy.withPackages (ps: with ps; [ hyrule requests ])
withPackages = python-packages: python.withPackages (ps: (python-packages ps) ++ [ ps.hy ]);
};
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 ];
};
}