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, buildPythonPackage,
fetchPypi, fetchPypi,
isPyPy, isPyPy,
bash,
setuptools, setuptools,
pytest, pytestCheckHook,
pytest-cov, pytest-cov-stub,
pytest-mock, pytest-mock,
freezegun, freezegun,
safety, git,
pre-commit,
jinja2, jinja2,
binaryornot, binaryornot,
click, click,
@ -34,17 +34,24 @@ buildPythonPackage rec {
hash = "sha256-2yH4Fp6k9P3CQI1IykSFk0neJkf75JSp1sPt/AVCwhw="; 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 = [ nativeCheckInputs = [
pytest pytestCheckHook
pytest-cov pytest-cov-stub
pytest-mock pytest-mock
freezegun freezegun
safety git
pre-commit
]; ];
propagatedBuildInputs = [
dependencies = [
binaryornot binaryornot
jinja2 jinja2
click click
@ -56,12 +63,17 @@ buildPythonPackage rec {
rich rich
]; ];
# requires network access for cloning git repos pythonImportsCheck = [ "cookiecutter.main" ];
doCheck = false;
checkPhase = '' preCheck = ''
pytest export HOME="$(mktemp -d)"
''; '';
disabledTests = [
# messes with $PYTHONPATH
"test_should_invoke_main"
];
meta = with lib; { meta = with lib; {
homepage = "https://github.com/audreyr/cookiecutter"; homepage = "https://github.com/audreyr/cookiecutter";
description = "Command-line utility that creates projects from project templates"; description = "Command-line utility that creates projects from project templates";