python312Packages.cookiecutter: run tests

This commit is contained in:
Robert Schütz 2024-08-22 15:14:55 -07:00
parent 4a1c8b8257
commit 53227486a6

View File

@ -3,13 +3,13 @@
buildPythonPackage,
fetchPypi,
isPyPy,
bash,
setuptools,
pytest,
pytest-cov,
pytestCheckHook,
pytest-cov-stub,
pytest-mock,
freezegun,
safety,
pre-commit,
git,
jinja2,
binaryornot,
click,
@ -34,17 +34,24 @@ buildPythonPackage rec {
hash = "sha256-2yH4Fp6k9P3CQI1IykSFk0neJkf75JSp1sPt/AVCwhw=";
};
nativeBuildInputs = [ setuptools ];
postPatch = ''
patchShebangs tests/test-pyshellhooks/hooks tests/test-shellhooks/hooks
substituteInPlace tests/test_hooks.py \
--replace-fail "/bin/bash" "${lib.getExe bash}"
'';
build-system = [ setuptools ];
nativeCheckInputs = [
pytest
pytest-cov
pytestCheckHook
pytest-cov-stub
pytest-mock
freezegun
safety
pre-commit
git
];
propagatedBuildInputs = [
dependencies = [
binaryornot
jinja2
click
@ -56,12 +63,17 @@ buildPythonPackage rec {
rich
];
# requires network access for cloning git repos
doCheck = false;
checkPhase = ''
pytest
pythonImportsCheck = [ "cookiecutter.main" ];
preCheck = ''
export HOME="$(mktemp -d)"
'';
disabledTests = [
# messes with $PYTHONPATH
"test_should_invoke_main"
];
meta = with lib; {
homepage = "https://github.com/audreyr/cookiecutter";
description = "Command-line utility that creates projects from project templates";