# HG changeset patch # User Denis Laxalde # Date 1475748943 -7200 # Node ID dd5df5fe7137f651608028deeb75d87d92908321 # Parent c16fe74d0a5f860b3225ee9548c6209915b3a183 [config] Exclude "pyramid" cube when initializing application cubes Related to #14023058. diff -r c16fe74d0a5f -r dd5df5fe7137 cubicweb/cwconfig.py --- a/cubicweb/cwconfig.py Wed Oct 05 16:20:52 2016 +0200 +++ b/cubicweb/cwconfig.py Thu Oct 06 12:15:43 2016 +0200 @@ -881,6 +881,11 @@ _cubes = None def init_cubes(self, cubes): + cubes = list(cubes) + if 'pyramid' in cubes: + self.warning("cubicweb-pyramid got integrated into CubicWeb; " + "remove it from your project's dependencies") + cubes.remove('pyramid') self._cubes = self.reorder_cubes(cubes) # load cubes'__init__.py file first for cube in cubes: diff -r c16fe74d0a5f -r dd5df5fe7137 cubicweb/test/unittest_cwconfig.py --- a/cubicweb/test/unittest_cwconfig.py Wed Oct 05 16:20:52 2016 +0200 +++ b/cubicweb/test/unittest_cwconfig.py Thu Oct 06 12:15:43 2016 +0200 @@ -142,6 +142,12 @@ ['email/views', 'email/hooks.py']) self.assertEqual(path[10:], ['test/data/entities.py', 'test/data/views.py']) + def test_init_cubes_ignore_pyramid_cube(self): + warning_msg = 'cubicweb-pyramid got integrated into CubicWeb' + with self.assertLogs('cubicweb.configuration', level='WARNING') as cm: + self.config.init_cubes(['pyramid', 'card']) + self.assertIn(warning_msg, cm.output[0]) + self.assertNotIn('pyramid', self.config._cubes) class CubicWebConfigurationWithLegacyCubesTC(CubicWebConfigurationTC):