51 lines
1.2 KiB
Nix
51 lines
1.2 KiB
Nix
{
|
|
gitMinimal,
|
|
python3Packages,
|
|
fetchFromGitHub,
|
|
lib,
|
|
}:
|
|
python3Packages.buildPythonPackage {
|
|
pname = "sphinx-last-updated-by-git";
|
|
version = "0.3.8-unstable-2025-08-26";
|
|
pyproject = true;
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "mgeier";
|
|
repo = "sphinx-last-updated-by-git";
|
|
rev = "07ac1a98af2a927e773a65c6524ce83067c977b8";
|
|
hash = "sha256-2TGFR11Ejh/9zpVC/TEdmMNaBt38wE5yeJeYixZSVUE=";
|
|
fetchSubmodules = true;
|
|
leaveDotGit = true;
|
|
};
|
|
|
|
build-system = [ python3Packages.setuptools ];
|
|
|
|
dependencies = with python3Packages; [
|
|
sphinx
|
|
gitpython
|
|
];
|
|
|
|
postPatch = ''
|
|
# we cant just substitute by matching `'git'` due to collisons
|
|
substituteInPlace src/sphinx_last_updated_by_git.py \
|
|
--replace-fail "'git', 'ls-tree'" " '${lib.getExe gitMinimal}', 'ls-tree'" \
|
|
--replace-fail "'git', 'log'" "'${lib.getExe gitMinimal}', 'log'" \
|
|
--replace-fail "'git', 'rev-parse'" "'${lib.getExe gitMinimal}', 'rev-parse'" \
|
|
'';
|
|
|
|
propagatedBuildInputs = [ gitMinimal ];
|
|
|
|
nativeCheckInputs = with python3Packages; [
|
|
pytestCheckHook
|
|
sphinx-pytest
|
|
pytest-cov-stub
|
|
];
|
|
|
|
disabledTests = [
|
|
"test_no_git" # we hardcoded the git path
|
|
|
|
"test_repo_shallow"
|
|
"test_repo_shallow_without_warning"
|
|
];
|
|
}
|