hy: replace it with python3Packages.hy

Add `hyDefinedPythonPackages` parameter to allow backwards compatibility
with interpreters/hy.

Fixes https://github.com/NixOS/nixpkgs/issues/171428.
main
Thiago Kenji Okada 2 years ago
parent e0b9154e58
commit 72fd5b71bc
  1. 40
      pkgs/development/interpreters/hy/builder.nix
  2. 15
      pkgs/development/interpreters/hy/default.nix
  3. 12
      pkgs/development/python-modules/hy/default.nix
  4. 2
      pkgs/top-level/all-packages.nix

@ -1,40 +0,0 @@
{ lib
, python3Packages
, hyDefinedPythonPackages /* Packages like with python.withPackages */
, ...
}:
python3Packages.buildPythonApplication rec {
pname = "hy";
version = "1.0a1";
src = python3Packages.fetchPypi {
inherit pname version;
sha256 = "sha256-lCrbvbkeutSNmvvn/eHpTnJwPb5aEH7hWTXYSE+AJmU=";
};
checkInputs = with python3Packages; [ flake8 pytest ];
propagatedBuildInputs = with python3Packages; [
appdirs
astor
clint
colorama
fastentrypoints
funcparserlib
rply
pygments
] ++ (hyDefinedPythonPackages python3Packages);
# Hy does not include tests in the source distribution from PyPI, so only test executable.
checkPhase = ''
$out/bin/hy --help > /dev/null
'';
meta = with lib; {
description = "A LISP dialect embedded in Python";
homepage = "https://hylang.org/";
license = licenses.mit;
maintainers = with maintainers; [ nixy mazurel ];
platforms = platforms.all;
};
}

@ -1,15 +0,0 @@
{ lib
, callPackage
, hyDefinedPythonPackages ? python-packages: [] /* Packages like with python.withPackages */
}:
let
withPackages = (
python-packages: callPackage ./builder.nix {
hyDefinedPythonPackages = python-packages;
}
);
in
(withPackages hyDefinedPythonPackages) // {
# Export withPackages function for hy customization
inherit withPackages;
}

@ -5,8 +5,10 @@
, fetchFromGitHub , fetchFromGitHub
, funcparserlib , funcparserlib
, pytestCheckHook , pytestCheckHook
, python
, pythonOlder , pythonOlder
, rply , rply
, hyDefinedPythonPackages ? python-packages: [] /* Packages like with python.withPackages */
}: }:
buildPythonPackage rec { buildPythonPackage rec {
@ -27,9 +29,13 @@ buildPythonPackage rec {
colorama colorama
funcparserlib funcparserlib
rply # TODO: remove on the next release rply # TODO: remove on the next release
] ++ lib.optionals (pythonOlder "3.9") [ ]
++ lib.optionals (pythonOlder "3.9") [
astor astor
]; ]
# for backwards compatibility with removed pkgs/development/interpreters/hy
# See: https://github.com/NixOS/nixpkgs/issues/171428
++ (hyDefinedPythonPackages python.pkgs);
checkInputs = [ checkInputs = [
pytestCheckHook pytestCheckHook
@ -48,6 +54,6 @@ buildPythonPackage rec {
description = "Python to/from Lisp layer"; description = "Python to/from Lisp layer";
homepage = "https://github.com/hylang/hy"; homepage = "https://github.com/hylang/hy";
license = licenses.mit; license = licenses.mit;
maintainers = with maintainers; [ fab thiagokokada ]; maintainers = with maintainers; [ fab mazurel nixy thiagokokada ];
}; };
} }

@ -35047,7 +35047,7 @@ with pkgs;
simplenote = callPackage ../applications/misc/simplenote { }; simplenote = callPackage ../applications/misc/simplenote { };
hy = callPackage ../development/interpreters/hy {}; hy = with python3Packages; toPythonApplication hy;
wmic-bin = callPackage ../servers/monitoring/plugins/wmic-bin.nix { }; wmic-bin = callPackage ../servers/monitoring/plugins/wmic-bin.nix { };

Loading…
Cancel
Save