resource addons/module

Bug #1004539 reported by Xavier Fernandez http://www.smile.fr
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Won't Fix
Wishlist
Unassigned

Bug Description

resource is an OFFICIAL python module: http://docs.python.org/library/resource.html

It would be nice to rename the openerp resource addons to something else to prevent this name conflict...

"import resource" will import openerp python addons in most of the cases, since the addons path is added to sys.path.

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

Hi Xavier,

Unfortunately it is impossible to avoid conflicts with all the current (and future) modules of the Python ecosystem in the "root" namespace. Renaming our modules just to avoid one such conflict (even with an official module) will only fix one case, it will cause a lot of backwards-incompatible and otherwise useless changes, *and* will not prevent future conflicts.
For example our "web" module contains the new OpenERP web client/framework, and it is in direct conflict with a popular Python web framework module: "web.py". This is as annoying as a conflict with Python's 'resource' package.
We prefer to find a global solution that will completely prevent this: a proper openerp namespace.

For the moment if you encounter such a conflict you will have to find a workaround such as pre-loading your module before OpenERP's resource module is loaded (via the --load server parameter), or altering yourself the sys.path when you need it.

For the future we will implement a clean solution: we'll move all the openerp modules under a clean namespace: "openerp.addons". So our "resource" module will exclusively be available under "openerp.addons.resource". This is a big change that has to be foreseen over several releases because we'll have to eventually break backwards-compatibility, so it will probably be done after release 7.0.

Thanks

Changed in openobject-addons:
importance: Undecided → Wishlist
status: New → Won't Fix
Revision history for this message
Raphaël Valyi - http://www.akretion.com (rvalyi) wrote : Re: [Bug 1004539] Re: resource addons/module

On Mon, May 28, 2012 at 7:22 AM, Olivier Dony (OpenERP) <
<email address hidden>> wrote:

> Hi Xavier,
>
> [...]
> "openerp.addons.resource". This is a big change that has to be foreseen
> over several releases because we'll have to eventually break backwards-
> compatibility, so it will probably be done after release 7.0.
>

Hello Olivier, while I think namespaces is the right solution, I don't
understand that last statement. Why don't you do that change for version
7.0 ? Version 7.0 is a new major version as there is only every 12 or 18
months at best. Isn't that the right timing to do those backward
incompatible changes?

Regards.

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

On 05/28/2012 03:43 PM, Raphaël Valyi - http://www.akretion.com wrote:
> Hello Olivier, while I think namespaces is the right solution, I don't
> understand that last statement. Why don't you do that change for version
> 7.0 ? Version 7.0 is a new major version as there is only every 12 or 18
> months at best. Isn't that the right timing to do those backward
> incompatible changes?

LTS != Major. Currently there's a major version planned every 6 months, so the
one after 7.0 will be 7.1, etc. This refactoring of module namespace is a
project of its own, and if it's ready and stable in time for 7.0 it will be in
it. Otherwise it will be in the next one, as it's not a release blocker.
That's what I meant by "probably after 7.0".

Revision history for this message
Xavier Fernandez http://www.smile.fr (xav-fernandez) wrote :

Ok good news, thanks for the answer.
As far as I'm concerned, the sooner the better.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.