1{
2 lib,
3 python3Packages,
4 fetchFromGitHub,
5 git,
6}:
7
8python3Packages.buildPythonApplication rec {
9 pname = "git-archive-all";
10 version = "1.23.1";
11 format = "setuptools";
12
13 src = fetchFromGitHub {
14 owner = "Kentzo";
15 repo = "git-archive-all";
16 tag = version;
17 hash = "sha256-fIPjggOx+CEorj1bazz8s81ZdppkTL0OlA5tRqCYZyc=";
18 };
19
20 # * Don't use pinned dependencies
21 # * Remove formatter and coverage generator
22 # * Don't fail on warnings. Almost all tests output this warning:
23 # ResourceWarning: unclosed file [...]/repo.tar
24 # https://github.com/Kentzo/git-archive-all/issues/90
25 postPatch = ''
26 substituteInPlace setup.cfg \
27 --replace pycodestyle==2.5.0 "" \
28 --replace pytest==5.2.2 pytest \
29 --replace pytest-cov==2.8.1 "" \
30 --replace pytest-mock==1.11.2 pytest-mock \
31 --replace "filterwarnings = error" ""
32 substituteInPlace test_git_archive_all.py \
33 --replace "import pycodestyle" ""
34 '';
35
36 nativeCheckInputs = [
37 git
38 ];
39
40 checkInputs = with python3Packages; [
41 pytestCheckHook
42 pytest-cov-stub
43 pytest-mock
44 ];
45
46 disabledTests = [ "pycodestyle" ];
47
48 preCheck = ''
49 export HOME="$(mktemp -d)"
50 '';
51
52 meta = {
53 description = "Archive a repository with all its submodules";
54 longDescription = ''
55 A python script wrapper for git-archive that archives a git superproject
56 and its submodules, if it has any. Takes into account .gitattributes
57 '';
58 homepage = "https://github.com/Kentzo/git-archive-all";
59 license = lib.licenses.mit;
60 maintainers = with lib.maintainers; [ fgaz ];
61 mainProgram = "git-archive-all";
62 };
63}