Community mailing list archives

community@mail.odoo.com

Re: broken Travis builds in OCA repositories

by
Camptocamp France SAS, Alexandre Fayolle - Camptocamp
- 03/25/2015 05:28:18
On 25/03/2015 10:17, Stefan wrote:
> On 25-03-15 08:32, Alexandre Fayolle wrote:
> > Hello everyone,
> >
> > Following the introduction of
> > https://github.com/OCA/maintainer-quality-tools/issues/105 in maintainer
> > quality tools, some branch and PR builds have been failing.
> >
> > This is caused by external dependencies being imported by some addons
> > without a try...except block in a file which is imported at instance
> > startup, which is a bug in that module. Likely a couple of offending
> > addons are causing a large number of unrelated failures.
> >
> > I will make the required PRs and fixes today if noone beats me to it.
> > Apologies for the inconvenience.
>
> Hi Alexandre,
>
> thank you for picking this up. When we encountered this in the past, our
> solution was to import the external dependency locally in the methods
> themselves. This preserves the clear runtime error mentioning the
> missing dependency. Would you consider this solution instead of catching
> ImportError at the top of the modules?
>
>

That should be fine, yes, unless the addon is used in a tight loop. I'll
update the existing PRs and use this approach for the next ones.

-- 
Alexandre Fayolle
Chef de Projet
Tel : + 33 (0)4 79 26 57 94

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac Cedex
http://www.camptocamp.com