Skip to content
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

Use copier instead of cookiecutter #1

Closed
wants to merge 62 commits into from

Conversation

GenevieveBuckley
Copy link
Contributor

@GenevieveBuckley GenevieveBuckley commented Oct 27, 2023

This PR swaps copier for cookiecutter.
It is a fully working implementation that people can try out (as suggested by @jni, see context below)

napari/napari#6122 by @jni

Consider using copier instead of cookiecutter #6122

Some folks from the scientific Python ecosystem seem to like it.

One thing I like is that it has built-in support for updating projects when the template is updated: https://copier.readthedocs.io/en/stable/updating

Apparently cruft does this for cookiecutter templates but that seems like a more complex tool chain since it's not built into cookiecutter.

I don't have a strong opinion here, just want to share something I came across that could be interesting to implement, since updating downstream projects is something we have needed a lot of.

PR to the original cookiecutter repository: napari/cookiecutter-napari-plugin#165

Closes #2
Closes #3

@tlambert03
Copy link
Contributor

in case there's anything in here that might be useful to this effort, I had a copier template for napari plugins that I was working on a while back here https://github.com/tlambert03/napari-plugin-template
might be some patterns in there that are worth using. (the testing patterns in there might be useful too)

@tlambert03
Copy link
Contributor

tlambert03 commented Oct 27, 2023

I see there's a discussion of pytest-copie ... that was more or less the goal of these lines:
https://github.com/tlambert03/napari-plugin-template/blob/main/tests/test_generate.py#L15-L61

see also, there was a dream at one point to use that template for an npe2 create command, see original PR here: napari/npe2#225

but, I closed that cause... ya know

@jni
Copy link
Member

jni commented Oct 27, 2023

@GenevieveBuckley we need to get tests passing but repo permissions should be fixed.

@jni
Copy link
Member

jni commented May 22, 2024

Bah, I've made a mess of things, got too excited by Draga's "placeholder" comment. 😅 Which was spot on though. I think the last push should fix the tests. But for now it's bedtime. 🤞

@jni
Copy link
Member

jni commented May 22, 2024

Only comment I haven't addressed is @DragaDoncila's setup.cfg comment. @DragaDoncila is there any non redundant information in the setup.cfg? ie can we just delete the file in the template, or is there still metadata to be ported across?

@GenevieveBuckley
Copy link
Contributor Author

Is there any non redundant information in the setup.cfg? ie can we just delete the file in the template, or is there still metadata to be ported across?

I checked line by line before removing template/setup.cfg.jinja from the repository with git. I did not see any information that wasn't already in pyproject.toml (or that we didn't need at all, like test dependencies that are not required for plugins).

@GenevieveBuckley
Copy link
Contributor Author

Love the placeholders (thanks Draga!)
Just one question remaining: #1 (comment)

Czaki and others added 5 commits June 6, 2024 14:53
* Dependabot config for plugin template and new child plugins

* Add docs about how to enable Dependabot in your github settings

* Set dependabot interval to longest possible, i.e. monthly

* Add dependabot question to cookiecutter, remove files if option is not requested

* Add documentation about the dependabot config option

* Fix typo
@GenevieveBuckley GenevieveBuckley changed the base branch from main-copy to main June 7, 2024 04:54
@GenevieveBuckley GenevieveBuckley changed the base branch from main-cookiecutter to main June 10, 2024 07:17
@GenevieveBuckley
Copy link
Contributor Author

Closed in favour of #7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pre-commit is installed even when not required Investigate pytest-copie for testing copier template
6 participants