1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 isPyPy,
6 bash,
7 setuptools,
8 pytestCheckHook,
9 pytest-cov-stub,
10 pytest-mock,
11 freezegun,
12 git,
13 jinja2,
14 binaryornot,
15 click,
16 jinja2-time,
17 requests,
18 python-slugify,
19 pyyaml,
20 arrow,
21 rich,
22}:
23
24buildPythonPackage rec {
25 pname = "cookiecutter";
26 version = "2.6.0";
27 pyproject = true;
28
29 # not sure why this is broken
30 disabled = isPyPy;
31
32 src = fetchPypi {
33 inherit pname version;
34 hash = "sha256-2yH4Fp6k9P3CQI1IykSFk0neJkf75JSp1sPt/AVCwhw=";
35 };
36
37 postPatch = ''
38 patchShebangs tests/test-pyshellhooks/hooks tests/test-shellhooks/hooks
39
40 substituteInPlace tests/test_hooks.py \
41 --replace-fail "/bin/bash" "${lib.getExe bash}"
42 '';
43
44 build-system = [ setuptools ];
45
46 nativeCheckInputs = [
47 pytestCheckHook
48 pytest-cov-stub
49 pytest-mock
50 freezegun
51 git
52 ];
53
54 dependencies = [
55 binaryornot
56 jinja2
57 click
58 pyyaml
59 jinja2-time
60 python-slugify
61 requests
62 arrow
63 rich
64 ];
65
66 pythonImportsCheck = [ "cookiecutter.main" ];
67
68 preCheck = ''
69 export HOME="$(mktemp -d)"
70 '';
71
72 disabledTests = [
73 # messes with $PYTHONPATH
74 "test_should_invoke_main"
75 ];
76
77 meta = with lib; {
78 homepage = "https://github.com/audreyr/cookiecutter";
79 changelog = "https://github.com/cookiecutter/cookiecutter/blob/${version}/HISTORY.md";
80 description = "Command-line utility that creates projects from project templates";
81 mainProgram = "cookiecutter";
82 license = licenses.bsd3;
83 maintainers = with maintainers; [ kragniz ];
84 };
85}