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