diff --git a/pkgs/development/python-modules/cookiecutter/default.nix b/pkgs/development/python-modules/cookiecutter/default.nix index 5402b1764b00..8434666999b8 100644 --- a/pkgs/development/python-modules/cookiecutter/default.nix +++ b/pkgs/development/python-modules/cookiecutter/default.nix @@ -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";