Merge pull request #89085 from wigust/gita

Update gitAndTools.gita and add bash completion
This commit is contained in:
Mario Rodas 2020-06-29 14:52:55 -05:00 committed by GitHub
commit 79cd1cc2d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,17 +1,22 @@
{ lib { lib
, buildPythonApplication , buildPythonApplication
, fetchPypi , fetchFromGitHub
, git
, pytest
, pyyaml , pyyaml
, setuptools , setuptools
, installShellFiles
}: }:
buildPythonApplication rec { buildPythonApplication rec {
version = "0.10.5"; version = "0.10.9";
pname = "gita"; pname = "gita";
src = fetchPypi { src = fetchFromGitHub {
inherit pname version; sha256 = "0wilyf4nnn2jyxrfqs8krya3zvhj6x36szsp9xhb6h08g1ihzp5i";
sha256 = "1xggslmrrfszpl190klkc97fnl88gml1bnkmkzp6aimdch66g4jg"; rev = "v${version}";
repo = "gita";
owner = "nosarthur";
}; };
propagatedBuildInputs = [ propagatedBuildInputs = [
@ -19,6 +24,29 @@ buildPythonApplication rec {
setuptools setuptools
]; ];
nativeBuildInputs = [ installShellFiles ];
postUnpack = ''
for case in "\n" ""; do
substituteInPlace source/tests/test_main.py \
--replace "'gita$case'" "'source$case'"
done
'';
checkInputs = [
git
pytest
];
checkPhase = ''
git init
pytest tests
'';
postInstall = ''
installShellCompletion --bash --name gita ${src}/.gita-completion.bash
'';
meta = with lib; { meta = with lib; {
description = "A command-line tool to manage multiple git repos"; description = "A command-line tool to manage multiple git repos";
homepage = "https://github.com/nosarthur/gita"; homepage = "https://github.com/nosarthur/gita";