Commit 55b6c7e8 authored by Fabian Affolter's avatar Fabian Affolter
Browse files
parent a4eee8f7
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -9,23 +9,23 @@
  pre-commit,
}:

python3Packages.buildPythonApplication rec {
python3Packages.buildPythonApplication (finalAttrs: {
  pname = "jj-pre-push";
  version = "0.3.3";
  version = "0.3.4";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "acarapetis";
    repo = "jj-pre-push";
    tag = "v${version}";
    hash = "sha256-dZrZjzygT6Q7jIPkasYgJ2uN3eyPQXsg0opksookLYI=";
    tag = "v${finalAttrs.version}";
    hash = "sha256-sj1JM2gcwTRMeEXSozI73LCwxSf69t4u/SmovV7Cyeg=";
  };

  postPatch = ''
    substituteInPlace pyproject.toml \
      --replace-fail "typer-slim" "typer"
    substituteInPlace pyproject.toml \
      --replace-fail "uv_build>=0.8.2,<0.10.0" "uv_build"
      --replace-fail "uv_build>=0.8.2,<0.11.0" "uv_build"
  '';

  build-system = with python3Packages; [ uv-build ];
@@ -38,6 +38,7 @@ python3Packages.buildPythonApplication rec {
    ++ lib.optionals withPrecommit [ pre-commit ];

  nativeBuildInputs = [ installShellFiles ];

  postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
    installShellCompletion --cmd jj-pre-push \
      --bash <($out/bin/jj-pre-push --show-completion bash) \
@@ -45,15 +46,14 @@ python3Packages.buildPythonApplication rec {
      --zsh <($out/bin/jj-pre-push --show-completion zsh)
  '';

  pythonImportsCheck = [
    "jj_pre_push"
  ];
  pythonImportsCheck = [ "jj_pre_push" ];

  meta = {
    description = "Run pre-commit.com before `jj git push`";
    homepage = "https://github.com/acarapetis/jj-pre-push";
    changelog = "https://github.com/acarapetis/jj-pre-push/releases/tag/v${finalAttrs.src.tag}";
    license = lib.licenses.asl20;
    maintainers = with lib.maintainers; [ xanderio ];
    mainProgram = "jj-pre-push";
  };
}
})