hypothesis / hypothesis/cookiecutters

Enable `make template` to be run without upgrading to the latest version of the template

Open
#73 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
5
Forks
1
PR merge metrics
No merged PRs in 30d

Description

There are two reasons to run `make template`:

1. There have been changes to the cookiecutter and you want to apply them to the current project
2. You've changed something in the current project's `cookiecutter.json` file (for example: the Python versions) and you want to apply that change

Currently if a project isn't up to date with the latest cookiecutter and you've changed something in `cookiecutter.json` and want to apply it you can't do that without also applying the changes from the cookiecutter: `make template` will both apply the changes you've made in `cookiecutter.json` (e.g. changing the Python versions) and apply the changes from the cookiecutter at once.

It would be nice if the project's current version of the cookiecutter (commit SHA) were saved in `cookiecutter.json` and `make template` used that version of the cookiecutter instead of the latest. Then you could make changes to `cookiecutter.json` and run `make template` to apply them without also upgrading the project to the latest version of the cookiecutter. `make template args=upgrade` could be used to upgrade to the latest cookiecutter.

`make template` already has some of what we'd need to implement this. You can optionally put a `"checkout"` setting in `cookiecutter.json` and [`make template` will pass it](https://github.com/hypothesis/cookiecutters/blob/78488ea1c484307d2b55a8c2383d3e50e1573f81/_shared/project/bin/make_template#L26) to [cookiecutter's `checkout` option](https://cookiecutter.readthedocs.io/en/stable/cli_options.html?highlight=checkout#cmdoption-cookiecutter-c). Currently `"checkout"` in `cookiecutter.json` is `null` by default. We'd need to make it put in the SHA of the cookiecutter commit that was used instead.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.