Renaming github_username to github_owner + generating __repo_name & __repo_url#409
Renaming github_username to github_owner + generating __repo_name & __repo_url#409matt-graham merged 11 commits intomainfrom
github_username to github_owner + generating __repo_name & __repo_url#409Conversation
|
I'm 👍 , but reluctant to approve before we have some regression tests (#329) since there's a lot of changes here that could be susceptible to human error (e.g., missing or adding "/" characters from URLs) |
paddyroddy
left a comment
There was a problem hiding this comment.
Oo I didn't know about the private variables, big fan of this approach.
Are there any other private variables that we could leverage?
Isn't it enough the tests we currently have, all pass? We do do a cookiecut operation in CI, right? Which is working... |
|
Tests were previously failing since #432 was merged in as the passed configs now need to use |
|
Let's make |
| "max_python_version": ["3.13", "3.12", "3.11"], | ||
| "license": ["MIT", "BSD-3", "GPL-3.0"], | ||
| "funder": "", | ||
| "__repo_name": "{{cookiecutter.github_owner}}/{{cookiecutter.project_slug}}", |
There was a problem hiding this comment.
TIL __variable in cookiecutter.json, looks so clean!
Though its not exposed to user now we have longer prompts rather than using variable names directly, I think
github_usernameis a bit of a misnomer given that it can be either a user or organization name, hence I thinkgithub_ownerwould be a better choice.We also currently manually construct the GitHub repository URL in lots of different bits of the template and also the qualified repository name in a few places. We can use double underscore prefixed (rendered) private variables in the cookiecutter config to generate the repository URL and qualified name once and then reuse elsewhere to avoid the repetition. This would also make it simpler to later switch to supporting alternative repository hosting options such as GitLab in future (which is the rational for naming the variables
__repo_nameand__repo_urlrather than__github_repo_nameand__github_repo_url).