pyramid_jinja2 icon indicating copy to clipboard operation
pyramid_jinja2 copied to clipboard

convert scaffold to cookiecutter

Open mmerickel opened this issue 8 years ago • 14 comments

We're well on our way to deprecating pcreate [1] in pyramid 1.8 and switching all of our default scaffolds over to using cookiecutter [2][3]. It's only a deprecation right now with no removal until at least pyramid 1.10.

[1] https://github.com/Pylons/pyramid/issues/2384 [2] https://github.com/Pylons/pyramid-cookiecutter-starter [3] https://github.com/audreyr/cookiecutter

mmerickel avatar Oct 14 '16 18:10 mmerickel

Why not adopt jinja2 as default template engine instead upgrade this package? If jinja2 was choosen as default, pyramid_jinja2 is dead

marioidival avatar Nov 01 '16 14:11 marioidival

@marioidival why I would want a default of jinja2 and have it installed when I'm doing API or prefer mako? That's why scaffolds and cookiecutter exist, to have opinions for pyramid.

blaflamme avatar Nov 01 '16 14:11 blaflamme

Sorry @marioidival but I think you don't understand what this ticket is about.

mmerickel avatar Nov 01 '16 15:11 mmerickel

I've written https://github.com/domenkozar/pyramid-cookiecutter-jinja2, but I'd appreciate someone proof reading before we move it to the Pylons project.

I'll make a separate PR for pyramid_jinja2 to use the cookiecutter scaffold.

domenkozar avatar Dec 08 '16 14:12 domenkozar

Should we move scaffold related docs to cookiecutter repo from pyramid_jinja2 docs? http://docs.pylonsproject.org/projects/pyramid_jinja2/en/latest/#creating-a-jinja2-pyramid-project

domenkozar avatar Dec 09 '16 15:12 domenkozar

Should we move scaffold related docs to cookiecutter repo from pyramid_jinja2 docs?

I don't think so.

I was wondering also - we are going to convert the cookiecutter for the starter scaffold in pyramid over to jinja2. Is there a reason we shouldn't just rename the cookiecutter-jina2 to cookiecutter-starter and abandon the other one? I think this scaffold was made at a time when jinja2 was a second class citizen and now it is the most recommended renderer in all of our tutorials so maybe it doesn't need it's own personal one.

mmerickel avatar Dec 09 '16 18:12 mmerickel

I don't think so.

Roger, I'll keep it there then.

I was wondering also - we are going to convert the cookiecutter for the starter scaffold in pyramid over to jinja2. Is there a reason we shouldn't just rename the cookiecutter-jina2 to cookiecutter-starter and abandon the other one? I think this scaffold was made at a time when jinja2 was a second class citizen and now it is the most recommended renderer in all of our tutorials so maybe it doesn't need it's own personal one.

+1 for this, I'd say it's more mainstream than Chameleon today.

domenkozar avatar Dec 09 '16 18:12 domenkozar

Cool, so we should run a diff on the current pyramid-cookiecutter-jinja2 scaffold and the pyramid-cookiecutter-starter scaffold and decide if the jinja2 one is doing anything weird we want to fix and then copy it over to starter.

The main thing to me is that this scaffold does some i18n stuff which the starter doesn't do. I don't have a problem with that, but only if we make sure it actually works really well and that it matches pyramid's i18n docs. I'm tired of seeing issues opened that say pyramid's i18n docs don't work or that the scaffold does it the old way, etc. We need to standardize the extractors to be lingua or babel or whatever the current best practice is.

mmerickel avatar Dec 09 '16 19:12 mmerickel

If you change pyramid-cookiecutter-starter, should we also change the starter scaffold in Pyramid so they align?

stevepiercy avatar Dec 09 '16 21:12 stevepiercy

I'm personally not inclined to maintain the scaffolds going forward after we've deprecated them. However if people feel differently then I won't stop them.

mmerickel avatar Dec 09 '16 21:12 mmerickel

As a general note, I'm not inclined at all to delay the release of Pyramid 1.8 to do any of the work I suggested. Deprecating the scaffolds is proving to be a ton of work, and improving them at the same time is too much imo. It might be better to keep the pyramid-cookiecutter-starter the way it is for now with a simple conversion to jinja2 and not try to tackle the i18n issues I mentioned at this time... meaning do not merge the repositories yet and keep the pyramid_jinja2 one separate.

mmerickel avatar Dec 09 '16 21:12 mmerickel

I synched up the differences between pyramid-cookiecutter-starter and pyramid-cookiecutter-jinja2, and submitted a PR to the latter https://github.com/domenkozar/pyramid-cookiecutter-jinja2/pull/1. A couple of differences remain:

  • starter uses two templates, where one inherits from the other, whereas jinja2 uses one template
  • jinja2 has i18n stuff

I ran through the installation, ran tests successfully, and started up the app without problem.

I did not do anything with i18n or translations.

What are the next steps?

FWIW, I'm moving forward with using the starter on the Quick Tour and Tutorial. I'd like to see standardized i18n stuff.

stevepiercy avatar Dec 24 '16 09:12 stevepiercy

Whenever this issue is resolved, then also update Pyramid's docs https://github.com/Pylons/pyramid/blob/master/docs/narr/i18n.rst

stevepiercy avatar Dec 27 '16 08:12 stevepiercy

With the looming merger of all three cookiecutters into one, I think we can close this issue upon the release of Pyramid 1.10.

stevepiercy avatar Sep 27 '18 10:09 stevepiercy