Merge pull request #336634 from dotlambda/python3Packages.cookiecutter

python312Packages.cookiecutter: run tests
This commit is contained in:
Robert Schütz 2024-08-23 12:52:43 -07:00 committed by GitHub
commit 245ce92420
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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,14 +63,20 @@ 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";
changelog = "https://github.com/cookiecutter/cookiecutter/blob/${version}/HISTORY.md";
description = "Command-line utility that creates projects from project templates";
mainProgram = "cookiecutter";
license = licenses.bsd3;