Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #1463 (closed enhancement: fixed)

Opened 12 years ago

Last modified 10 years ago

Compile kid templates on installation

Reported by: chrisz Owned by: anonymous
Priority: normal Milestone: 1.x
Component: TurboGears Version: 1.0.3
Severity: minor Keywords: kid install


When a TG project is installed as an egg on a server, then the .py sources are automatically compiled to .pyc files. However, .kid templates are not automatically compiled to .pyc files at install time, and the runtime user may not have write access to the install directory (usually site-packages). I guess this is not a big problem, because they are cached in memory anyway, but maybe we can add something to the setup script to also compile all kid templates on installation. BTW, you can do this manually with

find . -name "*.kid" | xargs kidc

Change History

comment:1 Changed 11 years ago by faide

  • Milestone changed from 1.1 to 1.1.1

comment:2 Changed 11 years ago by faide

  • Milestone changed from 1.6 to 1.5

comment:3 Changed 10 years ago by Chris Arndt

How would you do this if the egg is installed in zipped form?

comment:4 Changed 10 years ago by chrisz

I think the original description of the problem is wrong. For eggs, the .pyc files are already included at build time, they are not compiled when installing. So the real problem is that compiled kid files should also be included in the egg, but they aren't.

comment:5 Changed 10 years ago by Chris Arndt

That should be easy to fix by changing the following line in the MANIFEST.in file

recursive-include tg11perftest/templates *.kid


recursive-include tg11perftest/templates *.kid *.pyc

Or am I wrong?

comment:6 Changed 10 years ago by chrisz

  • Milestone changed from 1.5 to 1.x

Did you try this? It does not seemt to work for me. Maybe you cannot include *.pyc files that way, or maybe I'mm doing something wrong?

But even if this works, it would not guarantee that all *.kid files are compiled in their current version, and it would include abandoned *.pyc files as well.

To solve this properly, I fear we must modify the build command, as explained here:  http://docs.python.org/distutils/extending.html

comment:7 Changed 10 years ago by chrisz

  • Status changed from new to closed
  • Resolution set to fixed

Better late than never: Implemented in r6869 for all TG 1.x branches now. Since it's most important for TG 1.0 which still has Kid templates as default, I fixed it there as well.

Note: See TracTickets for help on using tickets.