Unverified Commit 0f4060b1 authored by Aleksana's avatar Aleksana Committed by GitHub
Browse files

mbake: 1.2.4 -> 1.3.1; install completions (#423878)

parents c90ffe28 560499df
Loading
Loading
Loading
Loading
+13 −3
Original line number Diff line number Diff line
{
  stdenv,
  lib,
  fetchFromGitHub,
  installShellFiles,
  python3Packages,
  versionCheckHook,
}:

python3Packages.buildPythonApplication rec {
  pname = "mbake";
  version = "1.2.4";
  version = "1.3.1";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "EbodShojaei";
    repo = "bake";
    tag = "v${version}";
    hash = "sha256-RzM3HC3lYq93mngpqNCohcPMISWQ4+Lwa1V88S0O0To=";
    hash = "sha256-gQsie4/iUIe4g6ZH8bL33xW6CNxSg/sh429P4Xv0GjQ=";
  };

  build-system = [
    installShellFiles
    python3Packages.hatchling
  ];

@@ -26,13 +29,20 @@ python3Packages.buildPythonApplication rec {
    typer
  ];

  postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
    installShellCompletion --cmd mbake \
      --bash <($out/bin/mbake completions bash) \
      --fish <($out/bin/mbake completions fish) \
      --zsh <($out/bin/mbake completions zsh)
  '';

  nativeCheckInputs = [
    python3Packages.pytestCheckHook
    versionCheckHook
  ];
  versionCheckProgramArg = "--version";

  pythonImportsCheck = [ "bake" ];
  pythonImportsCheck = [ "mbake" ];

  meta = {
    description = "Makefile formatter and linter";