about summary refs log tree commit diff
path: root/pkgs/applications/version-management/git-archive-all/default.nix
blob: f38e08ba8c8eef40ca6eede68515cd018ec010b4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
{ lib
, buildPythonApplication
, fetchFromGitHub
, git
, pytestCheckHook
, pytest-mock
}:

buildPythonApplication rec {
  pname = "git-archive-all";
  version = "1.23.1";

  src = fetchFromGitHub {
    owner = "Kentzo";
    repo = "git-archive-all";
    rev = version;
    hash = "sha256-fIPjggOx+CEorj1bazz8s81ZdppkTL0OlA5tRqCYZyc=";
  };

  # * Don't use pinned dependencies
  # * Remove formatter and coverage generator
  # * Don't fail on warnings. Almost all tests output this warning:
  #   ResourceWarning: unclosed file [...]/repo.tar
  #   https://github.com/Kentzo/git-archive-all/issues/90
  postPatch = ''
    substituteInPlace setup.cfg \
      --replace pycodestyle==2.5.0 "" \
      --replace pytest==5.2.2 pytest \
      --replace pytest-cov==2.8.1 "" \
      --replace pytest-mock==1.11.2 pytest-mock \
      --replace "--cov=git_archive_all --cov-report=term --cov-branch" "" \
      --replace "filterwarnings = error" ""
    substituteInPlace test_git_archive_all.py \
      --replace "import pycodestyle" ""
  '';

  nativeCheckInputs = [
    git
  ];

  checkInputs = [
    pytestCheckHook
    pytest-mock
  ];

  disabledTests = [ "pycodestyle" ];

  preCheck = ''
    export HOME="$(mktemp -d)"
  '';

  meta = with lib; {
    description = "Archive a repository with all its submodules";
    longDescription = ''
      A python script wrapper for git-archive that archives a git superproject
      and its submodules, if it has any. Takes into account .gitattributes
    '';
    homepage = "https://github.com/Kentzo/git-archive-all";
    license = licenses.mit;
    maintainers = with maintainers; [ fgaz ];
    mainProgram = "git-archive-all";
  };
}