From f92a85b01a6387a4d38568d714084a0f3518b44f Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Wed, 5 Oct 2022 09:19:05 +0100 Subject: [PATCH 1/3] funcparserlib: 1.0.0a0 -> 1.0.0 --- .../python-modules/funcparserlib/default.nix | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/pkgs/development/python-modules/funcparserlib/default.nix b/pkgs/development/python-modules/funcparserlib/default.nix index ba535146cf25..0eab273848ec 100644 --- a/pkgs/development/python-modules/funcparserlib/default.nix +++ b/pkgs/development/python-modules/funcparserlib/default.nix @@ -1,7 +1,6 @@ { lib , buildPythonPackage , fetchFromGitHub -, fetchpatch , poetry-core , python , pytestCheckHook @@ -11,7 +10,7 @@ buildPythonPackage rec { pname = "funcparserlib"; - version = "1.0.0a0"; + version = "1.0.0"; format = "pyproject"; disabled = pythonOlder "3.6"; @@ -20,7 +19,7 @@ buildPythonPackage rec { owner = "vlasovskikh"; repo = pname; rev = version; - sha256 = "sha256-YfcboKjyc5ASzrp0duu2R6psf51MGZIeZ0owo5QNSnU="; + sha256 = "sha256-moWaOzyF/yhDQCLEp7bc0j8wNv7FM7cvvpCwon3j+gI="; }; nativeBuildInputs = [ @@ -32,15 +31,6 @@ buildPythonPackage rec { six ]; - patches = [ - # Support for poetry-core, https://github.com/vlasovskikh/funcparserlib/pull/73 - (fetchpatch { - name = "support-poetry-core.patch"; - url = "https://github.com/vlasovskikh/funcparserlib/commit/61ed558fc146b7a30879919325dfa8aae77be556.patch"; - sha256 = "sha256-tqdR3r4/t7RWBYZeAabaN7oYf6VxkVVz006XICX9rYI="; - }) - ]; - pythonImportsCheck = [ "funcparserlib" ]; From e265a79d176d309032a0957dca02c1dc46d45b11 Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Wed, 5 Oct 2022 09:23:50 +0100 Subject: [PATCH 2/3] hy: 1.0a4 -> 0.24.0 Not a downgrade, upstream returned to 0.* version numbers: https://github.com/hylang/hy/releases/tag/0.24.0 --- .../development/python-modules/hy/default.nix | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/pkgs/development/python-modules/hy/default.nix b/pkgs/development/python-modules/hy/default.nix index a962f86854f2..c25417ecef09 100644 --- a/pkgs/development/python-modules/hy/default.nix +++ b/pkgs/development/python-modules/hy/default.nix @@ -16,7 +16,7 @@ buildPythonPackage rec { pname = "hy"; - version = "1.0a4"; + version = "0.24.0"; format = "setuptools"; disabled = pythonOlder "3.7"; @@ -25,7 +25,7 @@ buildPythonPackage rec { owner = "hylang"; repo = pname; rev = version; - sha256 = "sha256-MBzp3jqBg/kH233wcgYYHc+Yg9GuOaBsXIfjFDihD1E="; + sha256 = "sha256-PmnYOniYqNHGTxpWuAc+zBhOsgRgMMbERHq81KpHheg="; }; # https://github.com/hylang/hy/blob/1.0a4/get_version.py#L9-L10 @@ -34,24 +34,26 @@ buildPythonPackage rec { propagatedBuildInputs = [ colorama funcparserlib - rply # TODO: remove on the next release - ] - ++ lib.optionals (pythonOlder "3.9") [ + ] ++ + 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); + (hyDefinedPythonPackages python.pkgs); checkInputs = [ pytestCheckHook ]; + preCheck = '' + # For test_bin_hy + export PATH="$out/bin:$PATH" + ''; + disabledTests = [ - # Don't test the binary - "test_bin_hy" - "test_hystartup" - "est_hy2py_import" + "test_circular_macro_require" + "test_macro_require" ]; pythonImportsCheck = [ "hy" ]; From 450d420811f6474cb16126889fd2f385924d35f1 Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Fri, 7 Oct 2022 10:10:24 +0100 Subject: [PATCH 3/3] 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. --- pkgs/development/python-modules/hy/default.nix | 15 +++++---------- pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/pkgs/development/python-modules/hy/default.nix b/pkgs/development/python-modules/hy/default.nix index c25417ecef09..c40ba37cec66 100644 --- a/pkgs/development/python-modules/hy/default.nix +++ b/pkgs/development/python-modules/hy/default.nix @@ -10,8 +10,6 @@ , pythonOlder , rply , testers -, toPythonApplication -, hyDefinedPythonPackages ? python-packages: [ ] /* Packages like with python.withPackages */ }: buildPythonPackage rec { @@ -37,10 +35,7 @@ buildPythonPackage rec { ] ++ 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 @@ -63,10 +58,10 @@ buildPythonPackage rec { package = hy; command = "hy -v"; }; - # also for backwards compatibility with removed pkgs/development/interpreters/hy - withPackages = python-packages: (toPythonApplication hy).override { - hyDefinedPythonPackages = python-packages; - }; + # 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; { diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 46799a97345a..0b8db8b1809b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -37099,7 +37099,7 @@ with pkgs; simplenote = callPackage ../applications/misc/simplenote { }; - hy = python3Packages.hy.withPackages (python-packages: [ ]); + hy = with python3Packages; toPythonApplication hy; wmic-bin = callPackage ../servers/monitoring/plugins/wmic-bin.nix { };