mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-13 09:13:17 +00:00
python312Packages.cookiecutter: run tests
This commit is contained in:
parent
4a1c8b8257
commit
53227486a6
@ -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";
|
||||
|
Loading…
Reference in New Issue
Block a user