country-template
country-template copied to clipboard
Use `cookiecutter` for bootstrapping
When I'm creating a new extension for my country model, I want it to be easy as tools that I already know like cookiecutter, si I can spend more time adding value to users.
I'm not sure what that would entail exactly: does this mean this repository would have to become a cookiecutter
-based template, replacing its bootstrap.sh
file with a cookiecutter
declaration, and requiring users to install and execute cookiecutter
?
Hello @MattiSG !
does this mean this repository would have to become a
cookiecutter
-based template, replacing itsbootstrap.sh
file with acookiecutter
declaration, and requiring users to install and executecookiecutter
?
Yes!
Bootstrapping a country/city would then be something like:
$ pip install cookiecutter
$ cookiecutter https://github.com/openfisca/country-template
organisation: segpres
country: chile
And then it would be iso functional —thanks to pre/post-hooks.
Pros
- Cross-platform, thus easier to maintain, ex: #47, #82
- Easily testable
- Template remains also testable
Cons
- It's a DSL —learning curve
Another con: third-party dependency.
This sounds like an interesting venue to solve #82, but also like a big investment. I would not personally invest in it for the moment considering the production experience there is with the current system, and the limited practical existing problems this seems to solve.
I was going to invest personally on this until some other issues took priority.
I still believe it is worth doing, maybe there are other options closer to what we do now that are easier to implement.
Did not see this thread, but thanks for pointing it out @MattiSG. Pull Request #139 does not change this conversation and possibly better prepares the way for it. I note the offline conversation also about utilising github workflows? to achieve the same objectives (but for github only).
Indeed, the reference for using GitHub Actions is https://github.com/OpenTermsArchive/demo-declarations/pull/12.
Thanks both @MattiSG and @verbman. I'm closing this issue as, even if the problem is still there, it is bound to a how from which I have distanced myself. I a need for a solution arises in the future, I'd rather open a new ticket.