-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code template research #33
Comments
Project comparison
CookiecutterCookiecutter is the most popular templating tool for projects in the Python ecosystem, though it's pretty good at being a cross-language tool. It's got a no-frills CLI which asks you questions (like project name, email addresses, etc) and fills them into the appropriate places. The main downside is that it's a one-time-use tool for a project. If the template evolves (as they tend to do), projects that were previously created using it do not get the updates (i.e., migrations). This is often okay, as projects don't necessarily need those updates, but having an option for them is not a terrible thing. CruftCruft is an interesting project in that it is a backwards-compatible extension to cookiecutter. Any cruft template is a cookiecutter template, and any cookiecutter template can be converted to a cruft template. The main goal is to bolt on migrations to a cookiecutter template so that you can update projects after the initial templating is done. Since cookiecutter is so prevalent, adopting cruft seems fairly low-risk. CopierCopier is a newer templating project that seems to have similar goals to cruft: allowing you to make updates to a project after the initial templating. There are some other minor differences like YAML instead of JSON for configuration, but they otherwise seem fairly similar based on the docs. YeomanYeoman is a templating tool for web applications. It seems to be a perfectly nice tool, but I don't think it's a great fit for this project. It is more tied to the |
EvaluationI don't have enough information to make a call as to which tool suits our needs right now, so plan to do a bit of testing. I like that cruft is backwards-compatible with cookiecutter, but it really comes down to how easy the resulting projects are to create and maintain. Some things I'd like to look out for:
|
A couple of notes base on more reading cookiecutter and copier docs:
Copier actually has a bit better of a story here. Just don't suffix the files with
Again, I think copier has a better story here. Just put a literal jinja if statement in a file/directory name to determine whether it is included. Cookiecutter has a somewhat ugly hook apparatus for this.
Both cruft and copier have similar files tracking history, and cookiecutter doesn't do migrations. The above make me want to try |
Closing as complete! |
Code templates tools
Motivation
We are going to be doing a number of client projects with a similar stack, and plan to hand off these projects to our clients at the end of the project. The intention is to keep code for these projects in GitHub, and the code will likely involve:
We would like to have a project template that integrates with a generation tool to rapidly make a project skeleton with the above features. Ideally, bootstrapping a new project will take under an hour.
Requirements
Some tooling requirements:
Some nice-to-haves:
The text was updated successfully, but these errors were encountered: