cookiecutter-hypermodern-python
cookiecutter-hypermodern-python copied to clipboard
Add Nox session for upgrading the Cookiecutter template
Update: I'm no longer planning to use cupper for this.
Something like this:
@nox.session(python="3.8")
def cupper(session: Session) -> None:
"""Upgrade the Cookiecutter template with cupper."""
install(session, "cupper")
session.run("cupper", ".cookiecutter.json", "cookiecutter")
We should contribute a --checkout
option to cupper, to avoid upgrading to master always. (And then pull in latest from GitHub Releases.)
Another question is should the Nox session attempt to create a PR or feature branch? This is may be better left to documentation.
git switch --create cookiecutter-merge
git merge cookiecutter
git push origin cookiecutter-merge
For poetry.lock it's best reset to ours and then updated using poetry add insecure-package && poetry remove insecure-package
.
If we want to get fancy with this, it may get tricky to do it in cupper and noxfile alone. So there's this crazy idea: Go ahead with some form of #208 and depend on it in the project. We could then provide all kinds of services to projects, without dumping the code into them, and with a clean dependency and versioning...