[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Doubt about developing plugins for python applications

On Mon, Apr 30, 2012 at 7:55 PM, Piotr Ożarowski <piotr@debian.org> wrote:
[BRAGA, Bruno, 2012-04-25]
> When compiling/building the source with setup.py, I encountered the problem
> that separating the plugin as an independent solution:
> program/
>     |
>     |---- setup.py
>     |
>     |---- plugins/
>     |         |
>     |         |--pluginA/
>     |         |
> the setup.py fails (obviously) because it does not find the
> packages/modules from programlib, which are only available to the main
> application source.

does setup.py really need to import programlib? If yes, then invoke it
with PYTHONPATH=/usr/share/program/

Thanks for the reply. Yep, that's correct.

> b) add current installation to python path (eg. /usr/share/program) so the
> plugin can import the programlib packages/modules.

plugins import programlib at runtime only, riht? Startup script is
adding . to the sys.path automaticall so plugins should see programlib,

I was worried about that because, depending on the system or installation, the location of the programlib may vary, right? So, I can not rely on leaving this sys.path hack hard-coded in the plugin, or can I?

Reply to: