Project: datamanagement
Issue DM-966: fix int/long conversion on 32-bit systems and selected 64-bit systems
tests/wrap.py fails in pex_config on 32-bit systems and some 64-bit systems (including Ubuntu 14.04) with the following: {code:no-linenum} tests/wrap.py ...EE.E. ====================================================================== ERROR: testDefaults (__main__.NestedWrapTest) Test that C++ Control object defaults are correctly used as defaults for Config objects. ---------------------------------------------------------------------- Traceback (most recent call last): File "tests/wrap.py", line 89, in testDefaults self.assert_(testLib.checkNestedControl(control, config.a.p, config.a.q, config.b)) File "/home/boutigny/CFHT/stack_5/build/pex_config/tests/testLib.py", line 987, in checkNestedControl return _testLib.checkNestedControl(*args) TypeError: in method 'checkNestedControl', argument 2 of type 'double' ====================================================================== ERROR: testInt64 (__main__.NestedWrapTest) Test that we can wrap C++ Control objects with int64 members. ---------------------------------------------------------------------- Traceback (most recent call last): File "tests/wrap.py", line 95, in testInt64 self.assert_(testLib.checkNestedControl(control, config.a.p, config.a.q, config.b)) File "/home/boutigny/CFHT/stack_5/build/pex_config/tests/testLib.py", line 987, in checkNestedControl return _testLib.checkNestedControl(*args) TypeError: in method 'checkNestedControl', argument 2 of type 'double' ====================================================================== ERROR: testReadControl (__main__.NestedWrapTest) Test reading the values from a C++ Control object into a Config object. ---------------------------------------------------------------------- Traceback (most recent call last): File "tests/wrap.py", line 82, in testReadControl config.readControl(control) File "/home/boutigny/CFHT/stack_5/build/pex_config/python/lsst/pex/config/wrap.py", line 212, in readControl __at=__at, __label=__label, __reset=__reset) File "/home/boutigny/CFHT/stack_5/build/pex_config/python/lsst/pex/config/wrap.py", line 217, in readControl self.update(__at=__at, __label=__label, **values) File "/home/boutigny/CFHT/stack_5/build/pex_config/python/lsst/pex/config/config.py", line 515, in update field.__set__(self, value, at=at, label=label) File "/home/boutigny/CFHT/stack_5/build/pex_config/python/lsst/pex/config/config.py", line 310, in __set__ raise FieldValidationError(self, instance, e.message) FieldValidationError: Field 'a.q' failed validation: Value 4 is of incorrect type long. Expected type int For more information read the Field definition at: File "/home/boutigny/CFHT/stack_5/build/pex_config/python/lsst/pex/config/wrap.py", line 184, in makeConfigClass fields[k] = FieldCls(doc=doc, dtype=dtype, optional=True) And the Config definition at: File "/home/boutigny/CFHT/stack_5/build/pex_config/python/lsst/pex/config/wrap.py", line 131, in makeConfigClass cls = type(name, (base,), {"__doc__":doc}) ---------------------------------------------------------------------- Ran 8 tests in 0.017s FAILED (errors=3) {code} There is a partial fix on u/jbosch/intwrappers; this seems to work for Ubuntu 14.04, but not on 32-bit systems.
Story points: 2