1{ lib
2, pythonPackages
3, fetchPypi
4, git
5}:
6
7pythonPackages.buildPythonApplication rec {
8 pname = "git-up";
9 version = "2.2.0";
10 format = "pyproject";
11
12 src = fetchPypi {
13 pname = "git_up";
14 inherit version;
15 hash = "sha256-GTX2IWLQ48yWfPnmtEa9HJ5umQLttqgTlgZQlaWgeE4=";
16 };
17
18 nativeBuildInputs = with pythonPackages; [
19 poetry-core
20 ];
21
22 # git should be on path for tool to work correctly
23 propagatedBuildInputs = [
24 git
25 ] ++ (with pythonPackages; [
26 colorama
27 gitpython
28 termcolor
29 ]);
30
31 nativeCheckInputs = [
32 git
33 pythonPackages.pytest7CheckHook
34 ];
35
36 # 1. git fails to run as it cannot detect the email address, so we set it
37 # 2. $HOME is by default not a valid dir, so we have to set that too
38 # https://github.com/NixOS/nixpkgs/issues/12591
39 preCheck = ''
40 export HOME=$TMPDIR
41 git config --global user.email "nobody@example.com"
42 git config --global user.name "Nobody"
43 '';
44
45 postInstall = ''
46 rm -r $out/${pythonPackages.python.sitePackages}/PyGitUp/tests
47 '';
48
49 meta = with lib; {
50 homepage = "https://github.com/msiemens/PyGitUp";
51 description = "A git pull replacement that rebases all local branches when pulling";
52 license = licenses.mit;
53 maintainers = with maintainers; [ peterhoeg ];
54 platforms = platforms.all;
55 mainProgram = "git-up";
56 };
57}