From 1ec7b00db38ccc0f126fd453ee55568048d29feb Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sun, 2 Oct 2022 14:58:23 +0200 Subject: [PATCH] python3Packages.filecheck: Use buildPythonPackage Build using poetry-core, enabled tests, expose as top-level attribute. --- .../python-modules/filecheck/default.nix | 25 +++++++++++++++---- pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/filecheck/default.nix b/pkgs/development/python-modules/filecheck/default.nix index 2480c196881a..9cbd8bde2117 100644 --- a/pkgs/development/python-modules/filecheck/default.nix +++ b/pkgs/development/python-modules/filecheck/default.nix @@ -1,10 +1,11 @@ { lib -, buildPythonApplication +, buildPythonPackage , fetchFromGitHub -, poetry +, poetry-core +, pytestCheckHook }: -buildPythonApplication rec { +buildPythonPackage rec { pname = "filecheck"; version = "0.0.22"; format = "pyproject"; @@ -16,9 +17,23 @@ buildPythonApplication rec { sha256 = "sha256-I2SypKkgcVuLyLiwNw5oWDb9qT56TbC6vbui8PEcziI="; }; - nativeBuildInputs = [ poetry ]; + postPatch = '' + substituteInPlace pyproject.toml \ + --replace "poetry>=0.12" "poetry-core" \ + --replace "poetry.masonry.api" "poetry.core.masonry.api" + ''; - pythonImportsCheck = [ "filecheck" ]; + nativeBuildInputs = [ + poetry-core + ]; + + checkInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ + "filecheck" + ]; meta = with lib; { homepage = "https://github.com/mull-project/FileCheck.py"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c65f3321a4b1..b88d696138f6 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -13398,6 +13398,8 @@ with pkgs; fasmg = callPackage ../development/compilers/fasmg { }; + filecheck = with python3Packages; toPythonApplication filecheck; + firrtl = callPackage ../development/compilers/firrtl { }; flasm = callPackage ../development/compilers/flasm { };