[SciPy-Dev] Cython code generation with Jinja2 templates

Mark Alexander Mikofski mikofski at berkeley.edu
Fri Aug 31 13:07:57 EDT 2018


Thanks! Although looks like Tempita is inactive, the site link is broken,
and the last release was in 2013. It looks like the most current fork which
adds py3 compat is https://github.com/gjhiggins/tempita - is that what you
are using? Any opposition to Jinja2? Jinja2 seems to work and it's already
a requirement of SciPy via Sphinx, and it looks very similar to Tempita.

On Fri, Aug 31, 2018 at 1:04 AM Evgeni Burovski <evgeny.burovskiy at gmail.com>
wrote:

> Maybe better use Tempita, which we use already. For instance,
>
>
> https://github.com/scipy/scipy/blob/master/scipy/linalg/_decomp_update.pyx.in
> On Fri, Aug 31, 2018 at 10:58 AM Mark Alexander Mikofski
> <mikofski at berkeley.edu> wrote:
> >
> > Hi All,
> >
> > I would like to use Jinja2 templates to generate the Cython pyx and pxd
> files necessary for the Cython Optimize Zeros API proposed in #8431, maybe
> in a follow up PR
> >
> > https://github.com/scipy/scipy/pull/8431
> >
> > Does anyone have any experience with code generation in SciPy? Is it
> best to generate the files offline and then commit them to the repository,
> or is it better to add some scripting to either setup.py or to the CI yaml
> config files?
> >
> > I put something together in a branch in my scipy fork, and it recreates
> the existing code verbatim. See the templates folder and
> _generate_zeros_type.py script.
> >
> >
> https://github.com/mikofski/scipy/tree/cython_optimize_generate_code/scipy/optimize/cython_optimize
> >
> > Any comments would be greatly appreciated.
> >
> > thanks!
> > Mark
> > --
> > Mark Mikofski, PhD (2005)
> > Fiat Lux
> > _______________________________________________
> > SciPy-Dev mailing list
> > SciPy-Dev at python.org
> > https://mail.python.org/mailman/listinfo/scipy-dev
> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev at python.org
> https://mail.python.org/mailman/listinfo/scipy-dev
>


-- 
Mark Mikofski, PhD (2005)
*Fiat Lux*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20180831/f370dec9/attachment.html>


More information about the SciPy-Dev mailing list