From: Picca Frédéric-E. <pi...@de...> - 2016-03-09 10:13:08
|
--- lib/taurus/external/ordereddict/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/taurus/external/ordereddict/__init__.py b/lib/taurus/external/ordereddict/__init__.py index caf0c37..d38bdce 100644 --- a/lib/taurus/external/ordereddict/__init__.py +++ b/lib/taurus/external/ordereddict/__init__.py @@ -27,7 +27,7 @@ from __future__ import absolute_import try: # ordereddict from python 2.7 or from ordereddict installed package? - from ordereddict import * + from collections import OrderedDict except ImportError: # ordereddict from local import import os |
From: Carlos P. <cpa...@ce...> - 2016-03-09 10:43:10
|
Hi, I have an objection against this patch: We have 3 cases here: a) python<2.7 and ordereddict module installed (e.g. from pypi) b) python<2.7 and ordereddict module not installed ==> use local copy c) python==2.7 (ordereddict comes from collections) The original code worked for a) and b) but not for c) (which it treated as if it was b) With your patch, it would work for b) and c) but not for a) (which it would be treated as b) ) The proper solution should try the collections.ordereddict, then ordereddict and only then revert to the local copy. BUT: I understand that this is only a problem if the local copy of ordereddict is removed (as done for the debian packages) but not if installed from the "official" sources (since in practice, falling back to the local copy is ok). So I wonder if it may make more sense to just apply your patch as part of the packaging of taurus3.7 **for debian** instead of forcing a hotfix in the official package (which is not affected in practice). Specially considering that it would be a temporary workaround because with taurus4, python 2.6 is no longer supported so the taurus.external.ordereddict package can be deprecated What do you think? Carlos On Wed 9 March 2016 10:55:10 Picca Frédéric-Emmanuel wrote: > --- > lib/taurus/external/ordereddict/__init__.py | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/taurus/external/ordereddict/__init__.py > b/lib/taurus/external/ordereddict/__init__.py index caf0c37..d38bdce > 100644 > --- a/lib/taurus/external/ordereddict/__init__.py > +++ b/lib/taurus/external/ordereddict/__init__.py > @@ -27,7 +27,7 @@ from __future__ import absolute_import > > try: > # ordereddict from python 2.7 or from ordereddict installed > package? - from ordereddict import * > + from collections import OrderedDict > except ImportError: > # ordereddict from local import > import os > > ---------------------------------------------------------------------- > -------- Transform Data into Opportunity. > Accelerate data analysis in your applications with > Intel Data Analytics Acceleration Library. > Click to learn more. > http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140 > _______________________________________________ > Tauruslib-devel mailing list > Tau...@li... > https://lists.sourceforge.net/lists/listinfo/tauruslib-devel -- +----------------------------------------------------+ Carlos Pascual Izarra Scientific Software Coordinator Computing Division ALBA Synchrotron [http://www.albasynchrotron.es] Carrer de la Llum 2-26 E-08290 Cerdanyola del Valles (Barcelona), Spain E-mail: cpa...@ce... Phone: +34 93 592 4428 +----------------------------------------------------+ |
From: PICCA Frederic-E. <fre...@sy...> - 2016-03-09 14:47:23
|
> What do you think? I think that I applyed the patch in the debian package n order to fix the package for now. I think that the right fix is to remove the python <2.7 support :) and use the "official" collections source for OrderedDict. (Ps pyton2 is leggacy the best would be to support python 3.5 and type hinting ;) What I think also is that I prefer (from a packager point of view) peoples to install dependencies instead of embeding third party libraries :) My problem is that continuous integration did not catch this problem because upstream and packager usally do not follow the same policy. - packaged hate embeded third_party library and remove them. - upstream usually embed third-party code because it is easier from them to distribut there code. This is more a faillure of the python distribution module, that the fault of pythonistas :). Nevertheless, I think that with pip is is better, and we should let peoples install all dependencies via pip instead of embeding code. So to summarise I thik that collections should be used and fall back to the embeded solution for python 2.6 until it get's removed. Cheers Fred |
From: Carlos P. <cpa...@ce...> - 2016-03-09 15:14:19
|
I agree with all you say. I just prefer not to force a hotfix for this because with the transition to Taurus4 we already have too much work. PS: in order not to forget this, I created this ticket: https://sourceforge.net/p/tauruslib/tickets/271/ On Wed 9 March 2016 14:47:09 PICCA Frederic-Emmanuel wrote: > > What do you think? > > I think that I applyed the patch in the debian package n order to fix > the package for now. > > I think that the right fix is to remove the python <2.7 support :) and > use the "official" collections source for OrderedDict. (Ps pyton2 is > leggacy the best would be to support python 3.5 and type hinting ;) > > What I think also is that I prefer (from a packager point of view) > peoples to install dependencies instead of embeding third party > libraries :) > > My problem is that continuous integration did not catch this problem > because upstream and packager usally do not follow the same policy. > > - packaged hate embeded third_party library and remove them. > - upstream usually embed third-party code because it is easier from > them to distribut there code. > > This is more a faillure of the python distribution module, that the > fault of pythonistas :). > > Nevertheless, I think that with pip is is better, and we should let > peoples install all dependencies via pip instead of embeding code. > > So to summarise > > I thik that collections should be used and fall back to the embeded > solution for python 2.6 until it get's removed. > > > Cheers > > Fred -- +----------------------------------------------------+ Carlos Pascual Izarra Scientific Software Coordinator Computing Division ALBA Synchrotron [http://www.albasynchrotron.es] Carrer de la Llum 2-26 E-08290 Cerdanyola del Valles (Barcelona), Spain E-mail: cpa...@ce... Phone: +34 93 592 4428 +----------------------------------------------------+ |