nixpkgs/pkgs/development/python-modules/gitpython/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

54 lines
1.1 KiB
Nix
Raw Normal View History

{ lib
, buildPythonPackage
, ddt
, fetchFromGitHub
, gitdb
, pkgs
2021-06-21 13:55:03 +00:00
, pythonOlder
, substituteAll
2021-06-21 13:55:03 +00:00
, typing-extensions
}:
buildPythonPackage rec {
pname = "gitpython";
version = "3.1.32";
format = "setuptools";
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "gitpython-developers";
repo = "GitPython";
rev = "refs/tags/${version}";
hash = "sha256-Bhgu57w5QYfq5hlTh5gCJhbdwUMU+u0nrova/2V2ed0=";
};
2021-06-21 13:55:03 +00:00
propagatedBuildInputs = [
ddt
gitdb
pkgs.gitMinimal
] ++ lib.optionals (pythonOlder "3.10") [
2021-06-21 13:55:03 +00:00
typing-extensions
];
postPatch = ''
substituteInPlace git/cmd.py \
--replace 'git_exec_name = "git"' 'git_exec_name = "${pkgs.gitMinimal}/bin/git"'
'';
# Tests require a git repo
doCheck = false;
pythonImportsCheck = [
"git"
];
meta = with lib; {
description = "Python Git Library";
homepage = "https://github.com/gitpython-developers/GitPython";
changelog = "https://github.com/gitpython-developers/GitPython/blob/${version}/doc/source/changes.rst";
license = licenses.bsd3;
maintainers = with maintainers; [ fab ];
};
}