diff --git a/pkgs/applications/version-management/git-archive-all/default.nix b/pkgs/applications/version-management/git-archive-all/default.nix new file mode 100644 index 000000000000..22f16692ec8e --- /dev/null +++ b/pkgs/applications/version-management/git-archive-all/default.nix @@ -0,0 +1,62 @@ +{ 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 ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c33c8bba2220..96423874360e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1813,6 +1813,8 @@ with pkgs; git-appraise = callPackage ../applications/version-management/git-appraise { }; + git-archive-all = python3.pkgs.callPackage ../applications/version-management/git-archive-all { }; + git-backup = callPackage ../applications/version-management/git-backup { openssl = openssl_1_1; inherit (darwin.apple_sdk.frameworks) Security;