On Thursday, August 14, 2014 6:15:31 AM UTC+2, RjOllos wrote:
>
> On Mon, Aug 4, 2014 at 7:13 AM, Samuel Degrande <samuel....@lifl.fr 
> <javascript:>> wrote:
>
>> In my setup (using Trac 1.0), we have several projects, each of them
>> inheriting from a common trac.ini.
>>
>> In the [inherit] section of the common trac.ini, I have a
>> plugins_dir = /etc/forge/plugins
>>
>> That /etc/forge/plugins is empty.
>>
>> I use apache + mod_wsgi, and for each project, I set
>> trac.env_path to /var/forge/projects/<project_name>/trac
>>
>>
>> I added a plugin in the 'local' plugins dir of one of this project.
>> (so in /var/forge/projects/<that_project>/trac/plugins)
>>
>> Despite what I expected, this plugin is available to all projects
>> (and it is listed in the 'About Trac' page of all projects).
>>
>> Is that the expected behavior ? Did I something wrong ?
>>
>>
>> Note: I have same behavior with 1.1.1, and afaik the "private" plugin
>> was hidden from other projects in Trac < 1.0 (but I may be wrong, it
>> was 3 years ago...)
>>
>>
>> Thx for your great work !
>
>
> This is somewhat of a guess, but I would think that 
>  /var/forge/projects/<that_project>/trac/plugins must be on sys.path. 
>

When you think about it, it really is the expected behaviour when running a 
forge in a single Python process (using a parent environment) and querying 
registries, setuptools and package tools to located named code. Once the 
plugin code loads into the process it will occupy that plugin name in the 
plugin registry across all projects, and Trac does not do any book-keeping 
to know from where the plugin originally loaded. We only use the location 
when iterating the plugins to see if it should be enabled. It won't be 
enough to use the same logic to filter the Plugin panel, as it will still 
be thrown off if the same plugin exists in two projects. What happens if 
you have two plugins with same name but at different versions? Trac cannot 
load/unload/reload Python code from a running proces.

There are a few lines about this in the documentation:

http://trac.edgewall.org/wiki/TracPlugins#Isthewrongversionofthepluginloading

Local plugins in a shared Python process is an illusion. Not surprisingly 
I've disabled the Plugins admin panel at CodeResort...


:::simon
https://www.coderesort.com

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-dev+unsubscr...@googlegroups.com.
To post to this group, send email to trac-dev@googlegroups.com.
Visit this group at http://groups.google.com/group/trac-dev.
For more options, visit https://groups.google.com/d/optout.

Reply via email to