REQ Github template repository
Closed this issue · 8 comments
It would be really convenient if this repo and the other examples could be converted into Github template repositories.
Dup of pybind/cmake_example#22 (in a different repo). I'd be fine with it, but I don't have permissions to change this or cmake_example. I do for scikit_build_example, so I can start with that one. @wjakob, could you set these two? It's just a checkbox at the top of settings on the main page. It adds a "template" button which duplicates the repo but does not fork. Users can still fork if they want to (see scikit_build_example).
It also might be nice to add a link to https://github.com/scikit-hep/cookie, which uses cookiecutter to make a new repo, and the "pybind11 setuptools" choice is pretty much this example (while following the Scikit-HEP Developer guidelines on style and packaging setup and CI).
This is a great idea! Although I think that it would be preferable to use a cookiecutter rather than a github-specific feature, as it would be more "open-source" friendly.
The problem with cookiecutter is that it's not very friendly in repo form - it forces someone to use cookiecutter, vs. looking at it in the repo as an example or just copying manually. The GitHub version simply adds a button that lets you "copy but not fork", and doesn't change the repo contents at all. (There's not a way to add template variables, or anything GitHub specific). As such, it's not "open-source" unfriendly; if we were to move to GitLab, you'd just enable the matching feature (if it exists, don't remember for GitLab).
Having a cookiecutter would not be a replacement for the example in that case, but extra. I'd just point to other cookies (like the one above) instead of maintaining something new. Setting up the CI for testing a cookie was a bit painful and not interested in repeating more times than necessary ;)
I was going to use https://github.com/carpentries/workshop-template as an example for how it used to be done manually, but they actually switched to using the GitHub template button. The old instructions were removed here: carpentries/workshop-template@7781190
The GitHub version simply adds a button that lets you "copy but not fork", and doesn't change the repo contents at all.
Yep, that's how open-source loses.
I've pushed the button to make this a template repo (+ the cmake variant)
Great, thanks.
For what it's worth, the workflow this button replaces for me is:
- creating a new repo
- downloading the contents of this repo as a zip from the Github page
- extracting the zip in the new repo and committing the files unchanged
Cookiecutter provides a more powerful workflow because it automatically adjusts the package name etc., but does require running an additional program, so the two options can easily coexist.
This doesn't require a special custom program, it just replaces forking, which is already a GitHub specific thing!. Open source git itself has no idea of forking. Sure, all web hosts tend to have a fork concept (and, unlike pull requests vs. merge requests, it's even usually the same name), but it's still host specific (GitHub, in this case). This just adds a button in the UI that skips the GitHub fork procedure and makes a simple true copy. That's it. Open source didn't lose anything.
Now if they provided a template syntax, like $NAME
or something, then I could see that as a (minor) loss for open source. But they don't; there are no repo changes. Cookie-cutter would not be very friendly for users wanting to look at an example; it would not be an example, but only a template for making cookies, and would be a very different repo. Not that that's bad, but it's different (and requires more work).
Besides, scikit-hep/cookie already provides this and includes powerful static checks and such, so I'm not in a hurry to duplicate work for myself. :)