-
Notifications
You must be signed in to change notification settings - Fork 887
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
deprecate pcreate and update scaffolds to cookiecutter #2384
Comments
@cguardia did some work on a cookiecutter template for Pyramid: https://github.com/cguardia/cookiecutter-pyramid He wound up filing a cookiecutter ticket about automating the creation of a virtualenv (behind an optional argument.) CookieCutter turned him down, but he did it his own way, although I disagreed with him (he required the virtualenv package to be installed to get Py 2/3, I suggested to ignore Py2 for the flag and just automate pyvenv.) Anyway, details details. I very very much support looking at throwing our weight behind CookieCutter and the idea that you can install using recipes that aren’t pip-installed. In fact, I plan to lobby PyCharm at some point to make it a first-class experience. —Paul
|
Another little nit is that it doesn't appear there's a way to host multiple cookiecutters from the same repo via subpaths so we would have to extract them from |
Also, the work done by @cguardia in that repo is excellent and answers several of my other questions about using cookiecutter that I hadn't found in their docs. |
@mmerickel I'm currently maintaining the turbogears2 project and as Pyramid and TG2 share some legacy over Pylons we faced the same concern in the past. At the time we started porting TurboGears2 to Python3 I got in touch with Chris McDonough about the possibility of sharing a common project for what's pserve, pcreate and so on between Pyramid and TG. During the effort of moving the TG stack away from Pylons and porting it to Py3 we created the Gearbox project ( http://github.com/TurboGears/gearbox ) which in fact includes most of the features Pyramid p* suite of command provides. One interesting point is that the template based commands of Gearbox should actually be compatible with the currently existing Pyramid scaffolds both in terms of templates and directory structure (as both come from the Paster legacy) but they provide support for more advanced constructs like conditionals and loops. That would allow to share not only the overhead of maintaining the scaffolding system but also pserve and pshell commands can be shared as both the frameworks use the PasteDeploy convention. Off course I'm open to discuss any change gearbox might need to integrate/satisfy pyramid community needs but I think the idea is worth pursuing as it would only result in a better tool that can share the maintenance effort, bug reports and testing between the two communities and maybe lead also to a wider adoption outside of our communities in the future. Any feedbacks is well appreciated! |
Hey @amol- that's great! I hadn't heard of gearbox and will make a note to take a look. We're thinking about this stuff but it is mostly just thinking at this point. |
@mmerickel Well Gearbox relies on PasteDeploy mostly for the By the way I think that PasteDeploy (with all its limits) has a great advantage of being wildly supported by applications servers and supervisors like uwsgi or circus. And .ini files are usually appreciated by operations for the fact that it's simple to append options through scripts (just replace Maybe it can be considered to improve it to resolve some of its limits? For example CherryPy took the solution to use .ini files with typed values or nest them with I think also it should be fairly viable to support other formats in gearbox, if we can came up with a common one it might be easier to spread it over other tools again and have application servers relying on it. |
We now have repositories for the three original scaffolds using Cookie cutter. The postgen hooks proved enough to create the venv without adding any code to the jinja2 templates, and even run initialize_db in the alchemy template. We also run the pip --upgrade and the pip install -e from the hook. https://github.com/Pylons/pyramid-cookiecutter-starter |
I started a checklist at the top of this issue. Please add any other items that need to be done. |
Good job @stevepiercy on the checklist. If we change the Quick Tour from scaffolds to cookiecutter templates, and point at the jinja2 template, then we need to change the quick tutorial to use jinja2. That might be a lot for closing this ticket. Should we split into several phases? |
I updated the checklist in preparation for the PloneConf 2016 Pyramid sprint. @pauleveritt I think it is easier to track this whole thing in a single issue with a checklist, instead of several issues. Folks can take a bite size piece of the whole thing—say, Step 5 of Quick Tutorial—and submit a PR for that to master branch, while referring to this issue as the central hub for tracking. We can also break out the checklists for quick_tutorial and quick_tour as we go through each step along the way for more detailed tracking. |
The PloneConf sprint is using material created by Cris Ewing, not the quick tutorial. |
@pauleveritt how does Cris Ewing's material affect what is done at the sprint for Pyramid at PloneConf? I am not familiar with Cris's material. |
My bad, you said sprint but I thought tutorial. —Paul
|
FTR, I mentioned this to @stevepiercy at a sprint, but as a reminder, while it should be no problem to remove the concrete scaffolds from pyramid itself at any time (alchemy, zodb, starter, etc), the pcreate command and the machinery to support it should hang around for a while and emit deprecation warnings because things like substanced actually rely on registering a scaffold (e.g. https://github.com/Pylons/substanced/blob/master/setup.py#L108) and instruct people in docs to use pcreate to bootstrap a project. Maybe instantiation of a pyramid.scaffolds.PyramidTemplate starts to emit a deprecation warning, just to signal to folks that the feature is going away. |
Of course, there's no plan to remove pcreate for a while. Substanced should, however, offer a cookiecutter. The cornice folks added one for cornice [1][2] in just a couple days after I warned them that we were deprecating it, so I'd hope substanced could do the same. [1] Cornices/cornice#388 |
@cguardia did this at the PyCon sprint. |
FTR, I put in a deprecation warning in @mcdonc @mmerickel Did I miss any items for the checklist at the top of this issue? |
Agreed. I think it’s Pyramid’s style in general to leave stuff in, but deprecated, for a few releases. —Paul
|
Updated checklist |
@stevepiercy I'm looking at what needs to be done on this and I see that you have a I started looking at the scaffolds themselves and have a couple issues so I'll just push commits to them directly. As far as gettings tests running on the scaffolds I'm starting to think about that and then I imagine there's a bit of work to be done on updating the tutorials. |
@mmerickel There's PR #2798 which needs updating. I don't know the best way to undo the zodb scaffold work that @palindromed did at ploneconf. I'll be returning to this issue after I finish #2633, and I can easily handle updating the docs. I think "Replicate Pyramid's scaffolds/tests.py to run on cookiecutters" and "Configure Travis-CI to run scaffold tests on cookiecutters" would be good for you to work on. Tests and Travis are not my strength. The last piece, "Change cookiecutters to use Jinja2 instead of Chameleon", I can do, too, but you're welcome to have at it, if you're itching to go. |
All of the cookiecutters have travis and appveyor setup to automatically run their test suites. |
How can I help with this one? Where can I pick up the work already done? |
I'll start work on these items this week: update tutorial steps, replacing invocation of scaffold with cookiecutter, in the following:
Is anyone working on the remaining items in the checklist at the top, or are they complete? |
I added a new task in the checklist at the top, which I would like to discuss and refine its scope:
I am leaning toward not adding a new page, unless there is something specific to pyramid_cookiecutters versus general cookiecutters. Each of the cookiecutters should have its documentation (mostly just a readme) fairly well standardized while referring to other sources including the official cookiecutter docs. |
@mmerickel each of the pyramid-cookiecutters has tests that test the generation of a project as well as the generated project. So is this item in the checklist needed?
|
I moved the |
The docs for the ZODB wiki using cookiecutter are ready for review: |
Work for this has been shifted to a new branch and started over at stevepiercy/docs-cookiecutter-changes-only. Rendered docs may be viewed at http://pyramid-stevepiercy.readthedocs.io/en/docs-cookiecutter-changes-only/tutorials/wiki/index.html |
I found a bunch of other files that contain the word "scaffold", and updated the checklist at the top of this issue for further review. bah, humbug! |
[edited by @stevepiercy to insert checklist]
pcreate
updateThis is OK, as we still ship scaffolds with Pyramid, but should be updated when we ultimately remove them.docs/designdefense.rst
docs/glossary.rst
docs/index.rst
docs/latexindex.rst
docs/typographical-conventions.rst
docs/narr/cookiecutters.rst
to immediately precedescaffolds.rst
docs/narr/assets.rst
docs/narr/commandline.rst
docs/narr/extending.rst
update- deferred. See convert scaffold to cookiecutter pyramid_jinja2#139docs/narr/i18n.rst
docs/narr/install.rst
docs/narr/introduction.rst
docs/narr/logging.rst
docs/narr/myproject/*
source files and wherever it isliterinclude
ddocs/narr/paste.rst
docs/narr/project.rst
docs/narr/scaffolding.rst
docs/narr/startup.rst
docs/narr/testing.rst
docs/narr/webob.rst
update- deferred. See Updatedocs/tutorial/modwsgi/index.rst
docs/tutorials/modwsgi.rst
for cookiecutters #2890docs/tutorials/wiki/*
docs/tutorials/wiki2/*
docs/quick_tutorial/*
docs/quick_tour*
zodbNeed to update PR Move to jinja2 #2798, removing this one part of @palindromed's effortDuplicate zodb cookiecutter, rename copy topyramid-cookiecutter-zodb-chameleon
, retain it in perpetuityhttps://github.com/Pylons/pyramid-cookiecutter-zodbReplicate Pyramid'sMoved to a new issue Replicate Pyramid'sscaffolds/tests.py
to run on cookiecuttersscaffolds/tests.py
to run on cookiecutters #2868, so as not to hold up 1.8.https://github.com/Pylons/pyramid-cookiecutter-starterhttps://github.com/Pylons/pyramid-cookiecutter-alchemyhttps://github.com/Pylons/pyramid-cookiecutter-zodbThis is for a few reasons.
It's possible to re-use the original virtualenv but it can make the filesystem layout differently for someone cloning the repo versus someone creating a new project if you do. The goal should be:
So now we always create a virtualenv from the same layout... a cloned or newly created project.
There is a big CON that maybe could be coordinated with the cookiecutter team. The hooks system is super simplistic in cookiecutter and does not seem to allow much runnable code. This means lots of logic we normally do in python would be put into the jinja2 templates. I feel to truly consider cookiecutter this would need to have a better story.
The text was updated successfully, but these errors were encountered: