astropy / package-template

Template for packages that use Astropy. Maintainer: @astrofrog
http://docs.astropy.org/projects/package-template/en/latest/
Other
60 stars 63 forks source link

Make rendered branch a GitHub template #480

Closed nstarman closed 11 months ago

nstarman commented 3 years ago

I'm not sure if there are technical details preventing this, but it would be great if the rendered branch (currently master) was a GitHub template and showed up as an option in the dropdown menu when creating a new repository.

Screen Shot 2020-09-10 at 16 01 41
pllim commented 3 years ago

GitHub repo template didn't exist when we created this. There is no current plan to migrate to use GitHub template.

nstarman commented 3 years ago

Makes sense. The current implementation of GitHub templates is pretty limited, but it looks like it might just be one click to set up ( https://github.blog/2019-06-06-generate-new-repositories-with-repository-templates/ ). I don't know if it can be limited to the rendered branch, leaving the cookiecutter main branch unchanged.

pllim commented 3 years ago

@Cadair is the cookiecutter expert here, so perhaps he can comment. 🤞 Also cc @embray

nstarman commented 3 years ago

Also, something that was mentioned in #421 — if this is possible, then adding a GitHub action to render and push to master from the cookiecutter branch would allow anyone forking the repository to add that action to their repository. Any repository fork would then also have a GitHub template that reflects changes in the cookiecutter branch.

pllim commented 3 years ago

Re: https://github.com/astropy/package-template/issues/480#issuecomment-690744704 -- Sounds interesting!

nstarman commented 3 years ago

Unfortunately I cannot do a PR for GH actions. I'll try to get something working on my fork and then share the yaml file.

embray commented 3 years ago

The existence of GitHub project templates is an entirely new discovery to me, so I'm not sure what this would entail. Sounds like a good idea though!

embray commented 3 years ago

Also, something that was mentioned in #421 — if this is possible, then adding a GitHub action to render and push to master from the cookiecutter branch would allow anyone forking the repository to add that action to their repository. Any repository fork would then also have a GitHub template that reflects changes in the cookiecutter branch.

That would work if they fork the repository, but what if they create it from a template, or from scratch?

Regardless, we could still come up with a mechanism (not necessarily reliant on forking) to use Actions to easily apply updates (or at least attempt to) from the package template. This should be done at the package owner's discretion though, not necessarily automatically.

embray commented 3 years ago

I see now that when creating a repository from a template it is possible to choose all branches from the template as well.

nstarman commented 3 years ago

I see now that when creating a repository from a template it is possible to choose all branches from the template as well.

Good to know. I was dreading the conversation about making main (master) the default branch.

embray commented 3 years ago

I see now that the feature is rather simple. I thought it might incorporate some cookie-cutter-like functionality, but it literally just copies the repository without explicitly forking or copying the history. So I think it makes total sense to just go ahead and do this. The Action niceties could come later, though it might not be too hard to add either (I have not worked with GitHub Actions yet other than a couple code reviews of other peoples' action implementations).

nstarman commented 3 years ago

As making this repo a GitHub template is just a button in settings, maybe this Issue should be tagged with keep-open for the Action implementation.

pllim commented 3 years ago

FWIW, I made https://github.com/spacetelescope/stsci-package-template into a static GitHub repo template. Maybe simple is good. You start with the barest possible skeleton as a package and then add stuff to it as needed, rather than starting off with all the bells and whistles and then trying to figure out which parts you don't really need. But YMMV.

pllim commented 11 months ago

https://github.com/astropy/package-template#deprecation-warning