Questions tagged [cookiecutter]

A command-line utility that creates projects from cookiecutters (project templates), e.g. creating a Python package project from a Python package project template.

A command-line utility that creates projects from cookiecutters (project templates), e.g. creating a Python package project from a Python package project template.

enter image description here

Project home.

132 questions
3
votes
2 answers

From PyPi to Conda-Forge

I used cookiecutter to create a simple python package that I pushed to Pypi. Next I want to get the package into the Conda ecosystem and found the conda-forge channel really powerful. My only problem is that publishing to conda-forge requires a…
Rutger Hofste
  • 4,073
  • 3
  • 33
  • 44
3
votes
1 answer

Create Django Project template using cookiecutter on Windows

I am trying to create cookiecutter project template in windows. As per the instructions on the official site: https://cookiecutter.readthedocs.io, I installed cookiecutter using pip. Next step mentioned on site is to use following command to create…
Vedant Parikh
  • 218
  • 2
  • 8
3
votes
1 answer

Can I stop the cookiecutter if my hook fails?

I'm using cookiecutter to help manage a web template. You can specify a special file hooks/pre_gen_project.py that will run before any of the template commands start. If it fails however, cookiecutter keeps going, even if hooks/pre_gen_project.py…
Hooked
  • 84,485
  • 43
  • 192
  • 261
2
votes
1 answer

mypy {{cookiecutter.project_slug}} is not a valid Python package name

I am building a cookiecutter template for a python package, and I want to run a bunch of checks for the template repo itself with pre-commit. A skeleton of the repo looks like this: my_cookiecutter_template | .pre-commit-config.yaml | …
Ben Jeffrey
  • 714
  • 9
  • 18
2
votes
1 answer

Python Cookie Cutter - Conditional Code Block?

Is it possible do some sort of conditional code block depending on the variable(s) set? I am trying to templatize a project which has some yaml configuration files. I would like a section of the yaml configuration to be optional though, but I do not…
Riley Hun
  • 2,541
  • 5
  • 31
  • 77
2
votes
2 answers

How to get cookiecutter to output to current working directory instead of nested directory?

We have a number of use cases where we'd like to be able to call cookiecutter and have the files and directories generated get put into the current working directory. Simple example What is essentially desired. $ cd path/to/repo $ ls a.txt $…
conner.xyz
  • 6,273
  • 8
  • 39
  • 65
2
votes
0 answers

How does one conditionally get null as a default value in cookiecutter prompts?

Here is my example cookiecutter.json and Jinja logic { "pick_one": [ "Choice A", "Choice B" ], "user_name": "{%- if cookiecutter.pick_one == 'Choice A' -%} mydefault {%- else -%} null {%- endif -%}", "full_name":…
Patrick
  • 2,044
  • 1
  • 25
  • 44
2
votes
0 answers

How to provide a list of arguments to cookiecutter?

I am trying to build a cookiecutter template for a terraform repository. The repo is used to create buckets. I would like to add a "buckets" argument, where bucket is a list. I tried something like this in the cookiecutter.json. { "buckets":…
Alex
  • 389
  • 4
  • 21
2
votes
1 answer

How can I have a choice variable with values that depends on a previous choice variable selection?

I am using cookiecutter to create a project template for Reveal.js presentations (just for context). A given template has multiple themes that can be selected, but the theme list in not the same for all templates. Is there a way to modify the theme…
2
votes
1 answer

FastAPI docker-compose File Not Found Error

I have to run a project generated by full-stack-fastapi-postgresql and I'm stuck at the first step of launching the app: docker-compose up -d throws a FileNotFoundError. I am pretty sure that it's not a hard problem or an issue, just I am missing…
2
votes
0 answers

xtensor-python-cookiecutter cannot successfully build my module as expected, when using openmp

I encountered a problem when using openmp in xtensor-python with xtensor-python-cookiecutter. After executing python setup.py build, I encountered an error when import myLib: undefined symbol: omp_get_thread_num. And below is my log of python…
jokervtv
  • 21
  • 3
2
votes
2 answers

Can't install Cookiecutter please?

I've tried installing an existing cookiecutter (git@github.com:Dekalabs/cookiecutter-backend.git) both from ubuntu and the windows terminal, and I get the following error: Traceback (most recent call last): File…
Suki
  • 177
  • 3
  • 12
2
votes
0 answers

Cookiecutter command on git repo with template returning error

I am trying to run cookiecutter https://github.com/user/template (user is the account and template is the repository that contains the cookiecutter template I created) in an empty repo but whenever I try to run the command, I receive this error: …
2
votes
1 answer

How to import the module to test into the test module

The problem I have a directory structure for my project which follows the standard for Python packages, as it was created with this cookiecutter template: https://github.com/audreyr/cookiecutter-pypackage#quickstart The directory structure is…
2
votes
0 answers

In production Page not Found Error when trying to access Django /admin on deployed Heroku app

Friends - I have a django app (build with cookiecutter) and I have it deployed on Heroku, following these steps here: https://cookiecutter-django.readthedocs.io/en/latest/deployment-on-heroku.html Everything works fine and I can also create…
Micromegas
  • 1,499
  • 2
  • 20
  • 49
1 2
3
8 9