# \[UHD\] Replacing Cheetah Templates with Mako

**URL:** <https://www.ruby-forum.com/t/uhd-replacing-cheetah-templates-with-mako/242619>\
**Category:** GNU Radio\
**Created:** [July 7, 2015, 7:33pm UTC](https://www.ruby-forum.com/t/uhd-replacing-cheetah-templates-with-mako/242619 "2015-07-07T19:33:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![musicdenotation](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@musicdenotation](https://www.ruby-forum.com/u/musicdenotation)\
**Post date:** [July 7, 2015, 7:33pm UTC](https://www.ruby-forum.com/t/uhd-replacing-cheetah-templates-with-mako/242619/1 "2015-07-07T19:33:34Z")

</div>

Dear UHD users,

We will be replacing Cheetah as a template engine with the less-dead  
Mako template engine. I have pushed a branch for feedback etc. to our  
github page:  
[https://github.com/EttusResearch/uhd/tree/uhd/python3\_mako\_831](https://github.com/EttusResearch/uhd/tree/uhd/python3_mako_831)

This only affects people building UHD from source. People using binaries  
will not care or even need to know about this.

_Why are we doing this?_ The issue with Cheetah is, the project seems  
inactive and has not been updated in a long while. Also, it is not  
Python 3 compatible, and some of the distributions we support are  
starting to switch over to Python 3 as the default. We spent some time  
researching other template engines not only for quality and features,  
but also for stability of API, user base, community etc. Mako is used  
widely on the webs, and has a mostly backward-compatible API for several  
years now, as well as an active community.

_What does UHD need a template engine for?_ We use it to auto-generate  
code in some places. It saves us from typing out long, boring and  
repetitive sources files, which a computer can do much better than a  
human without typos. We do _not_ use it during runtime or anytime after  
installation.

_When will this be changed?_ Soon, and will be permanent for the next  
major release (3.9.0).

_Doesn’t GNU Radio work fine with Cheetah?_ GNU Radio is facing similar  
issues (e.g. no Python 3 compatibility), but Cheetah is much more deeply  
woven into GNU Radio and it’s harder to replace, and such things can’t  
happen unless for major releases. It’s certainly not a single commit as  
for UHD.

I’ll leave this public branch up for a bit, and will then merge this  
into master – but I’m happy for any feedback!

Thanks,  
Martin

---

<div class="post-metadata">

**Author:** ![pytlik](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/779978/32.png) [@pytlik](https://www.ruby-forum.com/u/pytlik)\
**Post date:** [July 7, 2015, 8:00pm UTC](https://www.ruby-forum.com/t/uhd-replacing-cheetah-templates-with-mako/242619/2 "2015-07-07T20:00:26Z")

</div>

On 07/07/2015 01:27 PM, Martin B. wrote:

> _Why are we doing this?_ The issue with Cheetah is, the project seems  
> repetitive sources files, which a computer can do much better than a  
> for UHD.
> 
> I’ll leave this public branch up for a bit, and will then merge this  
> into master – but I’m happy for any feedback!
> 
> Thanks,  
> Martin
> 
> * * *
> 
> D  
> OK, so for those of us who maintain builder packages, like  
> build-gnuradio, what new packages do I need in the pre-reqs? Just  
> python-mako, or are  
> there more packages that are required?

---

<div class="post-metadata">

**Author:** ![pytlik](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/779978/32.png) [@pytlik](https://www.ruby-forum.com/u/pytlik)\
**Post date:** [July 7, 2015, 8:09pm UTC](https://www.ruby-forum.com/t/uhd-replacing-cheetah-templates-with-mako/242619/3 "2015-07-07T20:09:12Z")

</div>

On 07.07.2015 10:59, Marcus D. Leech wrote:

> OK, so for those of us who maintain builder packages, like  
> build-gnuradio, what new packages do I need in the pre-reqs? Just  
> python-mako, or are  
> there more packages that are required?

Excellent question: For Ubuntu, Debian + Fedora, it depends on the  
Python version, so it’s either python-mako or python3-mako. Mako can  
also be installed from PyPi using e.g. ‘pip install Mako’.

There are no other packages required. Note you (for build-gnuradio)  
can’t rip out Cheetah because it’s still required by GNU Radio.

Cheers,  
Martin
