unethical blogger - Cheetah http://unethicalblogger.com/taxonomy/term/18/0 Posts involving the Cheetah Template engine which can be found at cheetahtemplate.org en Supporting Python 3 is a Ghetto http://unethicalblogger.com/posts/2010/02/supporting_python_3_ghetto <p>In my spurious free time I maintain a few Python modules (<a id="aptureLink_LvMqViext1" href="http://github.com/rtyler/py-yajl">py-yajl</a>, <a id="aptureLink_SEruJN7rBc" href="http://en.wikipedia.org/wiki/CheetahTemplate">Cheetah</a>, <a id="aptureLink_3HQW6OMHEx" href="http://github.com/rtyler/PyECC">PyECC</a>) and am semi-involved in a couple others (<a id="aptureLink_1I31I3RdtY" href="http://www.djangoproject.com/">Django</a>, <a id="aptureLink_7qs5LoY2eY" href="http://eventlet.net/">Eventlet</a>), only one of which properly supports Python 3. For the uninitiated, Python 3 is a backwards incompatible progression of the Python language and CPython implementation thereof, it's represented significant challenges for the Python community insofar that supporting Python 2.xx, which is in wide deployment, and Python 3.xx simultaneously is difficult.</p> <p>As it stands now my primary development environment is Python 2.6 on Linux/amd64, which means I get to take advantage of some of the nice things that were added to Python 3 and then back-ported to Python 2.6/2.7. Regular readers know about my undying love for Hudson, a Java-based continuous integration server, which I use to test and build all of the Python projects that I work on. While working this weekend I noticed that one of my C-based projects (py-yajl) was failing to link properly on Python 2.4 and 2.5. It might be easy to cut-off support for Python 2.4, which was first released over <strong>four years</strong> ago, there are still a number of heavy users of 2.4 (such as <a id="aptureLink_k20Tw96O5B" href="http://www.crunchbase.com/company/slide">Slide</a>), in fact it's still the default <code>/usr/bin/python</code> on Red Hat Enterprise Linux 5. What makes this C-based module special, is that thanks to <a id="aptureLink_l6Vcy3ytZB" href="http://twitter.com/teepark">Travis</a>, it runs properly on Python 3.1 as well. Since the Python C-API has been <em>fairly</em> stable through the 2 series into Python 3, maintaining a C-based module that supports multiple versions of Python.</p> <p>In this case, it's as easy as some simple pre-processor definitions:</p> <div class="geshifilter"><pre class="geshifilter-python"><ol><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"><span style="color: #808080; font-style: italic;">#if PY_MAJOR_VERSION &gt;= 3</span></div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"><span style="color: #808080; font-style: italic;">#define IS_PYTHON3</span></div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"><span style="color: #808080; font-style: italic;">#endif</span></div></li></ol></pre></div> <p>Which I can use further down the line to modify the handling some of the minor internal changes for Python 3:</p> <div class="geshifilter"><pre class="geshifilter-python"><ol><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"><span style="color: #808080; font-style: italic;">#ifdef IS_PYTHON3</span></div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> result = _internal_decode<span style="color: black;">&#40;</span><span style="color: black;">&#40;</span>_YajlDecoder <span style="color: #66cc66;">*</span><span style="color: black;">&#41;</span>decoder, PyBytes_AsString<span style="color: black;">&#40;</span>bufferstring<span style="color: black;">&#41;</span>,</div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> PyBytes_Size<span style="color: black;">&#40;</span>bufferstring<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span></div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> Py_XDECREF<span style="color: black;">&#40;</span>bufferstring<span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span></div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"><span style="color: #808080; font-style: italic;">#else</span></div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> result = _internal_decode<span style="color: black;">&#40;</span><span style="color: black;">&#40;</span>_YajlDecoder <span style="color: #66cc66;">*</span><span style="color: black;">&#41;</span>decoder, PyString_AsString<span style="color: black;">&#40;</span>buffer<span style="color: black;">&#41;</span>,</div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> PyString_Size<span style="color: black;">&#40;</span>buffer<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span></div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"><span style="color: #808080; font-style: italic;">#endif </span></div></li></ol></pre></div> <p>Not particularly <em>pretty</em> but it gets the job done, supporting all major versions of Python.</p> <h3>Python on Python</h3> <p>Writing modules in C is fun, can give you pretty good performance, but is not something you would want to do with a <strong>large</strong> package like Django (for example). Python is the language we all know and love to work with, a much more pleasant language to work with than C. If you build packages in pure Python, those packages have a much better chance running on top of IronPython or Jython, and the entire Python ecosystem is better for it.</p> <p>A few weeks ago when I started to look deeper into the possibility of Cheetah support for Python 3, I found a process riddled with faults. First a disclaimer, Cheetah is almost <strong>ten years</strong> old; it's one of the oldest Python projects I can think of that's still chugging along. This translates into some <em>very</em> old looking code, most people who are new to the language aren't familiar with some of the ways the language has changed in the past five years, let alone ten.</p> <p>The current means of supporting Python 3 with pure Python packages is as follows:</p> <ol> <li>Refactor the code enough such that <code>2to3</code> can process it</li> <li>Run <a id="aptureLink_GtN83eZUU3" href="http://docs.python.org/library/2to3.html">2to3</a> over the codebase, with the <code>-w</code> option to literally write the changes to the files</li> <li>Test your code on Python 3 (if it fails, go back to step 1)</li> <li>Create a source tarball, post to <a id="aptureLink_lvET3CCrpS" href="http://pypi.python.org/">PyPI</a>, continue developing in Python 2.xx </li> </ol> <p>I'm hoping you spotted the same problem with this model that I did, due to the reliance on <code>2to3</code> you are now trapped into <strong>always</strong> developing Python targeting Python <strong>2</strong>. This model will never succeed in moving people to Python 3, regardless of what amazing improvements it contains (such as the Unladen Swallow work) because you cannot develop on a day-to-day basis with Python 3, it's a magic conversion tool away.</p> <p>Unlike with a C module for Python, I cannot <code>#ifdef</code> certain segments of code in and out, which forces me to constantly use <code>2to3</code> <em>or</em> fork my code and maintain two separate branches of my project, duplicating the work for every change. With Python 2 sticking around on the scene for years to come (I don;t believe 2.7 will be the last release) I cannot imagine <strong>either</strong> of these workflows making sense long term.</p> <p>At a fundamental level, supporting Python 3 does not make sense for anybody developing modules, particularly open source ones. Despite Python 3 being "the future", it is currently impossible to develop using Python 3, maintaining support for Python 2, which <strong>all</strong> of us have to do. With enterprise operating systems like <a id="aptureLink_ehh7mOge8i" href="http://www.crunchbase.com/product/red-hat-enterprise-linux">Red Hat</a> or <a id="aptureLink_CklLBYgoAK" href="http://www.novell.com/linux/">SuSE</a> only now starting to get on board with Python 2.5 and Python 2.6, you can be certain that we're more than five years away from seeing Python 3 installed by default on any production machines. <!--break--></p> http://unethicalblogger.com/posts/2010/02/supporting_python_3_ghetto#comments Cheetah Python Software Development Sun, 21 Feb 2010 23:02:28 +0000 R. Tyler Croy 269 at http://unethicalblogger.com Using Cheetah templates with Django http://unethicalblogger.com/posts/2009/12/using_cheetah_templates_django <p>Some time ago after reading a post on <a href="http://www.eflorenzano.com/blog/post/cheetah-and-django/">Eric Florenzano's blog</a> about hacking together support for <a id="aptureLink_OfHfDIpuSN" href="http://en.wikipedia.org/wiki/CheetahTemplate">Cheetah</a> with <a id="aptureLink_0oRd4dQsSK" href="http://en.wikipedia.org/wiki/Django%20%28web%20framework%29">Django</a>, I decided to add "proper" support for Cheetah/Django to Cheetah v2.2.1 (released June 1st, 2009). At the time I didn't use Django for anything, so I didn't really think about it too much more.</p> <p>Now that I work at <a id="aptureLink_AYRRV0XTwi" href="http://www.crunchbase.com/company/apture">Apture</a>, which uses Django as part of its stack, Cheetah and Django playing nicely together is more attractive to me and as such I wanted to jot down a quick example project for others to use for getting started with Cheetah and Django. You can find the <a href="http://github.com/rtyler/django_cheetah_example">django_cheetah_example</a> project on GitHub, but the gist of how this works is as follows.</p> <h3>Requires</h3> <ul> <li><a href="http://www.djangoproject.com/">Django</a></li> <li><a href="http://cheetahtemplate.org">Cheetah</a> (>= v2.2.1)</li> </ul> <h3>Getting Started</h3> <p>For all intents and purposes, using Cheetah in place of Django's templating system is a trivial change in how you write your <em>views</em>.</p> <p>After following the Django <a href="http://docs.djangoproject.com/en/1.1/intro/tutorial01/">getting started</a> documentation, you'll want to create a directory for your Cheetah templates, such as <code>Cheetar/templates</code>. Be sure to <code>touch __init__.py</code> in your template directory to ensure that templates can be imported if they need to.</p> <p>Add your new template directory to the <code>TEMPLATE_DIRS</code> attribute in your project's <code>settings.py</code>.</p> <p>Once that is all set up, utilizing Cheetah templates in Django is just a matter of a few lines in your view code:</p> <div class="geshifilter"><pre class="geshifilter-python"><ol><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> <span style="color: #ff7700;font-weight:bold;">import</span> Cheetah.<span style="color: black;">Django</span></div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal">&nbsp;</div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> <span style="color: #ff7700;font-weight:bold;">def</span> index<span style="color: black;">&#40;</span>req<span style="color: black;">&#41;</span>:</div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> <span style="color: #ff7700;font-weight:bold;">return</span> Cheetah.<span style="color: black;">Django</span>.<span style="color: black;">render</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'index.tmpl'</span>, greet=<span style="color: #008000;">False</span><span style="color: black;">&#41;</span></div></li></ol></pre></div> <p><strong>Note</strong>: Any keyword-arguments you pass into the <code>Cheetah.Django.render()</code> function will be exposed in the template's "searchList", meaning you can then access them with $-placeholders. (i.e. <code>$greet</code>)</p> <p>With the current release of Cheetah (<a href="http://pypi.python.org/pypi/Cheetah/2.4.1">v2.4.1</a>), there isn't support for using pre-compiled Cheetah templates with Django (it'd be trivial to put together though) which means <code>Cheetah.Django.render()</code> uses Cheetah's dynamic compilation mode which can add a bit of overhead since templates are compiled at runtime (your mileage may vary). <!--break--></p> http://unethicalblogger.com/posts/2009/12/using_cheetah_templates_django#comments Cheetah Python Software Development Sat, 26 Dec 2009 20:31:11 +0000 R. Tyler Croy 247 at http://unethicalblogger.com One year of Cheetah http://unethicalblogger.com/posts/2009/12/one_year_cheetah <p>While working at <a id="aptureLink_yEeNgnHrmv" href="http://twitter.com/slideinc">Slide</a> I had a tendency to self-assign major projects, not content with things being "good-enough" I tended to push and over-extend myself to improve the state of Slide Engineering. Sometimes these projects would fail and I would get uncomfortably close to burning myself out, other times, such as the migration from <a id="aptureLink_RiTUKpPp5v" href="http://www.unethicalblogger.com/posts/2008/11/delightfully_wrong_about_git">Subversion to Git</a>, turned out to be incredibly rewarding and netted noticable improvements in our workflow as a company.</p> <p>One of my very first major projects was upgrading our installation of <a id="aptureLink_uxR2vwVN22" href="http://en.wikipedia.org/wiki/CheetahTemplate">Cheetah</a> from 1.0 to 2.0, at the time I vigorously <em>hated</em> Cheetah. My distain of the templating system stemmed from using a three year old version (that sucked to begin with) and our usage of Cheetah which bordered between "hackish" and "vomitable." At this point in Slide's history, the growth of the Facebook applications meant there was going to be far less focus on the Slide.com codebase which is where some of the more egregious Cheetah code lived; worth noting that I never "officially" worked on the Slide.com codebase. When I successfully convinced <a id="aptureLink_hqxRXAFs0S" href="http://twitter.com/jerobi">Jeremiah</a> and <a id="aptureLink_MaZ97GDvZ4" href="http://www.linkedin.com/pub/ken-brownfield/2/b0/b49">KB</a> that it was worth my time and some of their time to upgrade to Cheetah 2.0 which offered a number of improvements that we could make use of, I still held some pretty vigorous hatred towards Cheetah. My attitude was simple though, temporary pain on my part would alleviate pain inflicted on the rest of the engineering team further down the line. Thanks to fantastic QA by Ruben and Sunil, the Cheetah upgrade went down relatively issue free, things were looking fine in production and everybody went back to their regularly scheduled work.</p> <p>Months went by without me thinking of Cheetah too much until late 2008, Slide continued to write front-end code using Cheetah and developers continued to grumble about it. Frustrated by the lack of development on the project, I did the unthinkable, I started fixing it. Over the Christmas break, I used <a id="aptureLink_rIMU5Wn8T7" href="http://www.kernel.org/pub/software/scm/git/docs/git-cvsimport.html">git-cvsimport(1)</a> to create a git repository from the Cheetah CVS repo hosted with <a id="aptureLink_mPIIeTpoJW" href="http://www.crunchbase.com/company/sourceforge">SourceForge</a> and I started applying patches that had circulated on the mailing list. By mid-March I had a number of changes and improvements in my fork of Cheetah and I released "Community Cheetah". Without project administrator privileges on SourceForge, I didn't have much of a choice but to publish a fork on <a id="aptureLink_1h1STzYjMV" href="http://www.crunchbase.com/company/github">GitHub</a>. Eventually I was able to get a hold of <a id="aptureLink_295JgMxNNc" href="http://www.linkedin.com/pub/tavis-rudd/3/207/817">Tavis Rudd</a>, the original author of Cheetah who had no problem allowing me to become the maintainer of Cheetah proper, in a matter of months I had gone from hating Cheetah to fulfilling the oft touted saying "it's open source, fix it!" What was I thinking.</p> <p>Thanks in part to git and GitHub's collaborative/distributed development model patches started to come in and the Cheetah community for all intents and purposes "woke up." Over the course of the past year, Cheetah has seen an amazing number of improvements, bugfixes and releases. Cheetah now properly supports unicode throughout the system, supports @staticmethod and @classmethod decorators, supports use with Django and now supports Windows as a "first-class citizen". While I committed the majority of the fixes to Cheetah, five other developers contributed fixes:</p> <ul> <li><a id="aptureLink_M6cwowbGDF" href="http://www.linkedin.com/in/jbquenot">Jean-Baptiste Quenot</a> (unicode fixes)</li> <li><a id="aptureLink_wmWMUg3S3M" href="http://fedoraproject.org/wiki/MikeBonnet">Mike Bonnet</a> (unicode fixes, test fixes)</li> <li><a id="aptureLink_rENnnWb3Pw" href="http://www.linkedin.com/pub/james-abbatiello/2/589/421">James Abbatiello</a> (Windows support)</li> <li><a id="aptureLink_sQvNrSWDj6" href="http://github.com/arunk">Arun Kumar</a></li> <li>Doug Knight (fixes for #raw directive)</li> </ul> <p>In 2008, Cheetah saw 7 commits and 0 releases, while 2009 brought 342 commits and 10 releases; something I'm particularly proud of. Unforunately since I've left Slide, I no longer use Cheetah in a professional context but I still find it tremendously useful for some of my personal projects.</p> <p>I am looking forward to what 2010 will bring for the Cheetah project, which started in mid-2001 and has seen continued development since thanks to a number of contributors over the years.</p> http://unethicalblogger.com/posts/2009/12/one_year_cheetah#comments Cheetah Python Software Development Sun, 20 Dec 2009 01:04:49 +0000 R. Tyler Croy 245 at http://unethicalblogger.com Template Theory http://unethicalblogger.com/posts/2009/05/template_theory <p>Since becoming the (<em>de-facto</em>) maintainer of the <a href="http://www.cheetahtemplate.org">Cheetah project</a> I've been thinking more and more about what a templating engine <em>should</em> do and where the boundary between template engine and language are drawn. At their most basic level, template engines are means of programmatically generating large strings or otherwise massaging chunks of text. What tends to separate template engines from one another are: the language they're written in and what level of "host-language" access they offer the author of the template.</p> <p><a href="http://www.cheetahtemplate.org">Cheetah</a> is special in that for all intents and purposes Cheetah <strong>is</strong> <a href="http://www.python.org">Python</a> which blurs the line between the controller layer and the view layer, as Cheetah is compiled into literal Python code. In fact, one of the noted strengths of Cheetah is that Cheetah templates can subclass from regular Python objects defined in normal Python modules, and vice versa. That being the case, how do you organize your code, and where should particular portions physically reside in the source tree? What qualifies code to be entered into a <strong>.py</strong> file versus a <strong>.tmpl</strong> file? If you zoom out from this particular problem, to a larger scope, I believe there is a much larger question to be answered here: as a <em>language</em>, what should Cheetah provide?</p> <p>Since Cheetah compiles down to Python, does it merit introducing all the Python constructs that one has at their disposal within Cheetah, including:</p> <ul> <li>Properties</li> <li>Decorated methods</li> <li>Full/multiple inheritance</li> <li>Metaclasses/class factories</li> </ul> <p>Attacked from the other end, what <em>Cheetah-specific</em> language constructs are acceptable to be introduced into Cheetah as a Python-based hybrid language? Currently some of the language constructs that exist in Cheetah that are distinct to Cheetah itself are:</p> <ul> <li><code>#include</code></li> <li><code>#filter</code></li> <li><code>#stop</code></li> <li><code>#shBang</code></li> <li><code>#block</code></li> <li><code>#indent</code></li> <li><code>#transform</code></li> <li><code>#silent</code></li> <li><code>#slurp</code></li> <li><code>#encoding</code></li> </ul> <p>Some of the examples of unique Cheetah directives are necessary in order to manipulate template output in ways that aren't applicable to normal Python (take <code>#slurp</code>, <code>#indent</code>, <code>#filter</code> for example), but where does one draw the line?</p> <p>Too add yet another layer of complexity into the problem, Cheetah is not only used in the traditional Model-View-Controller set up (e.g. <a href="http://code.google.com/p/django-cheetahtemplate/">Django + Cheetah templates</a>) but it's also used to generate <em>other</em> code, i.e. Cheetah is sometimes used as a means of generating source code (<code>bash</code>, <code>C</code>, etc).</p> <h2>In My Humble Opinion</h2> <p>Cheetah, at least to me, is not a lump of text files that you can perform loops and use variables in, it is a fully functional, object-oriented, Pythonic text-aware programming language. Whether or not it compiles to Python or is fully interoperable with Python is largely irrelevant (that is not to say that <a href="http://www.slide.com">we</a> don't make use of this feature). As far as "what should Cheetah provide?" I think the best way to answer the question is to not think about Cheetah as Python, or as a "strict" template engine (Mako, Genshi, etc) but rather as a <em>domain specific language</em> for complex text generation and templating. When deciding on what Python features to expose as directives in Cheetah (the language) the litmus test that should be evaluated against is: <em>does this make generating text easier?</em></p> <p>Cheetah need not have hash-directives for every feature available in Python, the idea of requiring meta-classes in Cheetah is ridiculous at best, a feature like decorators however could prove quite useful in text processing/generation (e.g. function output filters), along with proper full inheritance.</p> <p>My goals ultimately with Cheetah, are to make <a href="http://www.slide.com">our</a> lives easier developing rich interfaces for our various web properties, but also to make "things" faster. Whereas "things" can fall under a few different buckets: development time, execution time, maintenance time.</p> <p>Cheetah will likely look largely the same a year from now, and if we (the developers of Cheetah) have done our jobs correctly, it should be just as simple to pick up and learn, but even more powerful and expressive than before.</p> http://unethicalblogger.com/posts/2009/05/template_theory#comments Cheetah Opinion Software Development Sat, 16 May 2009 20:41:51 +0000 R. Tyler Croy 217 at http://unethicalblogger.com Breathing life into a dead open source project http://unethicalblogger.com/posts/2009/04/breathing_life_dead_open_source_project <p>Over the past <a href="http://twitter.com/agentdero/status/1441656514">couple years</a> that I have been working at <a href="http://www.slide.com">Slide, Inc.</a> I've had a love/hate relationship with the <a href="http://www.cheetahtemplate.org">Cheetah</a> templating engine. Like almost every templating engine, it allows for abuse by its users, which can result in some templating code that looks quite horrendous, contributing significantly to some negative opinions of the templating engine. At one point, I figured an upgrade of Cheetah would help correct some of these abuses and I distinctly remember pushing to upgrade to the 2.xx series of Cheetah. I then found out that I had unintentionally volunteered myself to oversee the migration and also to update any <em>ancient</em> code that was lying around that depended on "features" (see: <em>bugs</em>) in Cheetah prior to the 2.xx series. We upgraded to Cheetah 2.xx and life was good, but Cheetah was practically dead.</p> <p>The last <strong>official</strong> release of Cheetah was in November of 2007, this is not something altogether uncommon in the world of open source development. Projects come and go, some reach a point in their growth and development where they're abandoned, or their community dissipates, etc. As time wore on, I found myself coming up with a patch here and there that corrected some deficiency in Cheetah, but I also noticed that many others were doing the same. There was very clearly a need for the project to continue moving forward, and with my introduction to both Git and <a href="http://www.github.com">GitHub</a> as a way of distributing development, I did what any weekend hacker is prone to do, I forked it. <!--break--></p> <h2>Meet Community Cheetah</h2> <p>On January 5th, 2009 I started to commit to my local fork of the Cheetah code base (taken from <a href="http://sourceforge.net/scm/?type=cvs&amp;group_id=28961">Cheetah CVS tree</a>), making sure my patches were committed but also taking the patches from a number of others on the <a href="https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss">mailing list</a>. By mid-March I had collected enough patches to properly announce <a href="http://sourceforge.net/mailarchive/forum.php?thread_name=20090316070839.GD31561%40starfruit.corp.slide.com&amp;forum_name=cheetahtemplate-discuss">Cheetah Community Edition v2.1.0</a> to the mailing list. I was entirely unprepared for the response.</p> <p>Whereas the previous 6 months of posts to the mailing list averaged about 4 messages a month, March exploded to <strong>88</strong> messages, 20 of them in the thread announcing Cheetah CE (now deemed <em>Community Cheetah</em> (it had a better ring to it, and an available <a href="http://www.communitycheetah.org">domain name</a> to boot)). All of a sudden the slumbering community is awake and the patches have started to trickle in.</p> <p>We've fixed some issues with running Cheetah on Python 2.6, Cheetah now supports compiling templates in parallel, issues with import behavior have been fixed and added a number of smaller features. In 2008 there were <strong>six</strong> commits to the Cheetah codebase, thus far in 2009 there have been over seventy (I'm still waiting on a few patches from colleagues at other startups in Silicon Valley as well).</p> <p>I'm not going to throw up a "Mission Accomplished" banner just yet, Cheetah still needs a large amount of improvement. It was written during a much different era of Python, the changes in Python 2.6 and moving forward to Python 3.0 present new challenges in modernizing a template engine that was introduced in <strong>2001</strong>.</p> <h2>Being a maintainer</h2> <p>Starting your own open source project is tremendously easy, especially with the advent of hosts like Google Code or GitHub. What's terrifying and difficult, is when other people depend on your work. By stepping up and becoming the de-facto maintainer of <a href="http://www.communitycheetah.org">Community Cheetah</a>, I've opened myself up to a larger collection of expectations than I originally anticipated. I feel as if I have zero credibility with the community at this point, which means I painstakingly check the changes that are committed and review as much code as possible before tagging a release. I'm scared to death of releasing a bad release of Community Cheetah and driving people away from the project, the nightmare scenario I play over in my head when tagging a release in Git is somebody going "this crap doesn't work at all, I'm going to stick with Cheetah v2.0.1 for now" such that I cannot get them to upgrade to subsequent releases of Community Cheetah. I think creators of a project have a lot of "builtin street cred" with their users and community of developers, whereas I still have to establish my street cred through introduction of bug fixes/features, knowledge of the code base and generally being available through the mailing list or IRC.</p> <h2>Moving Forward</h2> <p>Currently I'm preparing the third Community Cheetah release (which I tagged today) <a href="http://github.com/rtyler/cheetah/tarball/v2.1.1rc1">v2.1.1</a> which comes almost a month after the previous one and introduces a number of fixes but also some newer features like the <strong>#transform</strong> directive, markdown support, and 100% Python 2.6 compatibility.</p> <p>Thanks to an intrepid contributor, Jean-Baptiste Quenot, we have a v2.2 release lined up for the near future which fixes a <strong>large</strong> number of Unicode specific faults that Cheetah currently has (the code can currently be found in the <a href="http://github.com/rtyler/cheetah/tree/unicode">unicode branch</a>) and moves the internal representation of code within the Cheetah compiler/parser to a unicode string object in Python.</p> <p>I eagerly look forward to more and more usage of Cheetah, with other templating engines out there for Python like <a href="http://www.makotemplates.org/">Mako</a> and <a href="http://genshi.edgewall.org/">Genshi</a> I still feel Cheetah sits far and above the others in its power and versatility but has just been neglected for far too long.</p> <p>If you're interested in contributing to Cheetah, you can <a href="http://github.com/rtyler/cheetah/tree/master">fork it on GitHub</a>, join the <a href="http://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss">mailing list</a> or find us on IRC (#cheetah on Freenode).</p> <p>This experiment on restarting an open source project is far from over, but we're off to a promising start.</p> http://unethicalblogger.com/posts/2009/04/breathing_life_dead_open_source_project#comments Cheetah Miscellaneous Software Development Mon, 06 Apr 2009 08:33:48 +0000 R. Tyler Croy 215 at http://unethicalblogger.com