country-template icon indicating copy to clipboard operation
country-template copied to clipboard

Use `cookiecutter` for bootstrapping

Open bonjourmauko opened this issue 3 years ago • 6 comments

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.

bonjourmauko avatar May 02 '21 20:05 bonjourmauko

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?

MattiSG avatar Aug 09 '21 09:08 MattiSG

Hello @MattiSG !

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?

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
Cons
  • It's a DSL —learning curve

bonjourmauko avatar Aug 11 '21 17:08 bonjourmauko

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.

MattiSG avatar Aug 24 '21 11:08 MattiSG

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.

bonjourmauko avatar Aug 30 '21 08:08 bonjourmauko

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).

verbman avatar Apr 04 '24 05:04 verbman

Indeed, the reference for using GitHub Actions is https://github.com/OpenTermsArchive/demo-declarations/pull/12.

MattiSG avatar Apr 04 '24 06:04 MattiSG

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.

bonjourmauko avatar Aug 20 '24 15:08 bonjourmauko