New plugin installation problems

40 views
Skip to first unread message

RjOllos

unread,
Jul 10, 2012, 11:07:04 AM7/10/12
to trac-...@googlegroups.com
I've had a similar problem when forgetting to include an empty __init.py__ in the package directory. If that is not your issue, could you send your setup.py and a listing of your package layout?

paul.wilding

unread,
Jul 10, 2012, 11:26:07 AM7/10/12
to trac-...@googlegroups.com
Thanks for the replyI've now made a plugin which works using the tutorial on trac-hacks. However, whenever I change the names of the files and the references to them in the other files to something more useful than 'helloworld' the plugin stops working. The 2 copies I'm using are identical in code apart from the names - the only thing that differs is the SOURCES.txt file, which has far less references in it for the plugin which has the changed names. 

The directory structure for the working plugin is:

+helloworldplugin
+build
+bdist.win32
+lib
 +dist
 helloworldplugin-1.1-py2.7.egg
 +helloworld
+templates 
helloworld.html
__init__.py
helloworld.py
 +helloworldplugin.egg-info
dependency_links,txt
entry_points.txt 
PKG-INFO
SOURCES.txt
top_level.txt
create.bat
setup.py 
 
I've also attached my setup.py file. The structure for the renamed plugin is exactly the same and all references inside the fields have been changed correctly. 
setup.py

RjOllos

unread,
Jul 11, 2012, 2:20:48 AM7/11/12
to trac-...@googlegroups.com


On Tuesday, July 10, 2012 8:26:07 AM UTC-7, paul.wilding wrote:
Thanks for the replyI've now made a plugin which works using the tutorial on trac-hacks. However, whenever I change the names of the files and the references to them in the other files to something more useful than 'helloworld' the plugin stops working. The 2 copies I'm using are identical in code apart from the names - the only thing that differs is the SOURCES.txt file, which has far less references in it for the plugin which has the changed names.

You have a syntax error on the first line of your setup.py.

Could you just send your source with the renamed code/files and we can figure out where the problem is?

paul.wilding

unread,
Jul 11, 2012, 4:22:44 AM7/11/12
to trac-...@googlegroups.com
No idea how that syntax error got into the setup.py file!

I've attached the source code with the renamed bits for you, thanks again.
buildrequestsplugin.zip

RjOllos

unread,
Jul 12, 2012, 8:05:21 PM7/12/12
to trac-...@googlegroups.com


On Wednesday, July 11, 2012 1:22:44 AM UTC-7, paul.wilding wrote:
No idea how that syntax error got into the setup.py file!

I've attached the source code with the renamed bits for you, thanks again.

The plugin installed fine for me using `python setup.py install`. It also installs fine in development mode, `python setup.py develop -md /path/to/env/plugins-directory.

 You may want to direct TracLogging to the console and see if you have any errors.

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

paul.wilding

unread,
Jul 13, 2012, 5:57:07 AM7/13/12
to trac-...@googlegroups.com
Those commands worked for fine, thanks! I was using a batch file before with 'setup.py bdist_egg' to create the egg and then copying it into the plugins directory which was probably the problem. Will there be any issues with using the commands you suggested once I deploy the plugin?

On Tuesday, 10 July 2012 10:15:20 UTC+1, paul.wilding wrote:
I've made a new plugin and it creates an egg fine (although the sources.txt info file looks a bit sparse - it only contains the batch file for creating the egg and the setup.py file). I've copied it into the plugins directory on my testbed however it does not display on the admin page of trac and in the log when running in debug trac is not even attempting to add the plugin as it does with the rest of the plugins. The egg is readable, the python version is correct and I have enabled it in the trac.ini file so any help would really be appreciated!

RjOllos

unread,
Jul 13, 2012, 6:13:47 PM7/13/12
to trac-...@googlegroups.com
On Friday, July 13, 2012 2:57:07 AM UTC-7, paul.wilding wrote:
Will there be any issues with using the commands you suggested once I deploy the plugin?

The plugins will be installed in site-packages for your installation, which some say is not a good idea. I've been told that it is generally considered bad practice to install plugins globally when you will be running other applications in Python. My Trac instance is setup in a virtualenv, so it doesn't seem to matter in that case. Others will probably have more insightful comments on this.

It seems to work fine to copy the file into the $TRACENV/plugins directory through:

python setup.py bdist_egg
cp dist/buildrequestsplugin-1.2-py2.6.egg /path/to/trac-env/plugins/

Soha

unread,
Feb 12, 2014, 3:46:12 PM2/12/14
to trac-...@googlegroups.com
Hi,

I installed ticketcreationstatus plugin and the changes are not reflecting in the ticket status as I still see the status as new when a new ticket is submitted. I installed the wrong version of egg and all the python eggs in my plugin directory are having 2.7 version. I did an easy_install http://trac-hacks.org/svn/ticketcreationstatusplugin/ and the egg got created in python2.4/site-packages folder. I did copy paste it to the plugin folder and also made the changes in trac.ini and restarted the webserver.

Now the installation did not make any give me the output as expected.

I suspect it could be because of the mismatch of the python version. While installing I did not get option to select for a python version. How do I install the plugin which is compatible with python2.7 version?

Also please let me know if I am missing anything.

Thanks,

RjOllos

unread,
Feb 12, 2014, 4:19:29 PM2/12/14
to trac-...@googlegroups.com
On Wednesday, February 12, 2014 12:46:12 PM UTC-8, Soha wrote:
Hi,

I installed ticketcreationstatus plugin and the changes are not reflecting in the ticket status as I still see the status as new when a new ticket is submitted. I installed the wrong version of egg and all the python eggs in my plugin directory are having 2.7 version. I did an easy_install http://trac-hacks.org/svn/ticketcreationstatusplugin/ and the egg got created in python2.4/site-packages folder.

I did copy paste it to the plugin folder and also made the changes in trac.ini and restarted the webserver.

It is not necessary to move the file to the plugins folder. You may want to delete that file and easy_install it again in case something went bad in these steps.
 

Now the installation did not make any give me the output as expected.
 

I suspect it could be because of the mismatch of the python version. While installing I did not get option to select for a python version. How do I install the plugin which is compatible with python2.7 version?

Just run easy_install associated with your Python 2.7 installation. On Linux, you may be able to use:
/usr/bin/easy_install-2.7

If you still have issues:
 - Check if the plugin is visible on the plugin admin page. If it is, then at least the egg is being seen.
 - Turn on TracLogging and set the level to Debug, Restart the web server or tracd and look for messages about the plugin being loaded: http://trac.edgewall.org/wiki/TracLogging 

Soha

unread,
Feb 12, 2014, 4:45:56 PM2/12/14
to trac-...@googlegroups.com
Thanks a lot !

Doing /usr/bin/easy_install-2.7 worked me and I can also see that in the admin tab now. The tickets initial status is changed to the define one.

Appreciate all your prompt responses.

RjOllos

unread,
Feb 12, 2014, 4:49:20 PM2/12/14
to trac-...@googlegroups.com
Btw, we are looking at eliminating the hard-code "new" status in 
It will probably be part of 1.1.2 or 1.1.3. 
Reply all
Reply to author
Forward
0 new messages