[SciPy-Dev] Cython code generation with Jinja2 templates

Robert Kern robert.kern at gmail.com
Fri Aug 31 17:26:18 EDT 2018


On Fri, Aug 31, 2018 at 2:23 PM Charles R Harris <charlesr.harris at gmail.com>
wrote:

>
> On Fri, Aug 31, 2018 at 3:00 PM Robert Kern <robert.kern at gmail.com> wrote:
>
>> On Fri, Aug 31, 2018 at 12:47 PM Pauli Virtanen <pav at iki.fi> wrote:
>>
>>> Tempita is mature, and has worked fine for us. The "official" version
>>> at https://pypi.org/project/Tempita/ is Python 3 compatible (via 2to3).
>>> Jinja2 is much more heavily geared towards HTML generation, and for the
>>> use here I don't see it having much advantages.
>>>
>>
>> While we're on the subject, we might want to vendorize it. Right now,
>> we're preferentially using Cython's vendorized version, but they have
>> informed us that they consider that an implementation detail that external
>> users (like us) should not rely on.
>>
>>
>
> It is already in vendorized in NumPy, see `tools/npy_tempita` and works
> for both Python 2 and Python 3.
>

Cool. Should be easy to port that over to scipy, then.

https://github.com/scipy/scipy/blob/master/tools/cythonize.py#L112

-- 
Robert Kern
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20180831/cadd89e9/attachment-0001.html>


More information about the SciPy-Dev mailing list