How to install the Trac plugin and what is a python egg?

In Trac on Admin β†’ Plugins there is an option to install plugins. Now this option expects you to load a Python egg.

That would be nice, but due to the fact that all the Trac plugins I found are either regular .py files or zip files and are not compatible with the download function (I tried).

This leaves me with a bunch of questions:

  • Are there any Trac plugins that go into a Python egg?
  • What is a (Trac compatible) Python egg?
  • Is it difficult to repack a .py file into a Trac compatible Python egg?
  • If not: how is this done?
+4
source share
2 answers

Answers your questions in order.

  • Python eggs are binary packages that contain code for the application and some metadata. In this sense, they are not very different from deb or rpms. The egg itself is just a zip file containing all the above files with specific names and layouts. For more information about eggs (format and methods for creating them), see http://www.ibm.com/developerworks/library/l-cppeak3.html . It is probably a bit outdated, since the future (and present) of python packaging is a bit vague.
  • The trac plugin is a python program that uses the Trac plugin API to extend the functionality of trac. It can be packaged like an egg.
  • If your package is correctly placed and contains the setuptools / distribute setup.py , then issuing the python setup.py bdist_egg will create a .egg file for you. For more on this, see this (a bit dated but complete) and this (more, but still ongoing) . The Trac Growl plugin mentions this on the documentation page.
  • See paragraph above.
+3
source

I have not used trac for a year, but I remember that most plugins are accessible through subversion and are already packaged as eggs (which is a kind of installer in the python world, but I'm not very familiar with the concept).

Most plugins are available at http://trac-hacks.org/ , and the easiest way to install the plugin is

 easy_install http://svn.domain.tdl/path/to/plugin/ 

the folder should contain the setup.py file and the setup.cfg file. easy_install checks files from svn and installs the plugin. You can find here: http://trac.edgewall.org/wiki/TracPlugins

If the plugin makes changes to the database, you must call

 trac-admin upgrade 

from the console.

http://trac.edgewall.org/wiki/TracAdmin

If I remember correctly, installation via webinterface installs the plugin locally (for the instance), while easy_install installs it globally (for all running trac sites) and is a more common way to install the plugin.

Hint: after each installation of the plugin you need to restart trac Hint2: Most plugins do not tell you how to install and only give a link to the root of their svn. You only need to browse the svn folder and find the folder containing setup.py. The rest is done using easy_install.

Example:

Plugin: http://trac-hacks.org/wiki/GoogleChartPlugin

Wiki pages tell you: You can check out GoogleChartPlugin here using Subversion, or browse the source using Trac.

where here links to http://trac-hacks.org/svn/googlechartplugin/

svn contains two versions. Go to http://trac-hacks.org/svn/googlechartplugin/0.11/trunk/ and copy the path.

Then do

 easy_install http://trac-hacks.org/svn/googlechartplugin/0.11/trunk/ 
+4
source

All Articles