[pkg] Warn about "develop" command not installing legacy cubes directory
authorDenis Laxalde <denis.laxalde@logilab.fr>
Fri, 21 Oct 2016 18:35:46 +0200
changeset 11737 47e516587460
parent 11736 b77c82355325
child 11738 dc081e31501e
[pkg] Warn about "develop" command not installing legacy cubes directory Not sure we can do better than a warning, which is better than nothing anyways. Closes #15785635.
setup.py
--- a/setup.py	Fri Oct 21 18:43:13 2016 +0200
+++ b/setup.py	Fri Oct 21 18:35:46 2016 +0200
@@ -28,7 +28,7 @@
 from os.path import dirname, exists, isdir, join
 
 from setuptools import setup
-from setuptools.command import install_lib
+from setuptools.command import develop, install_lib
 from distutils.command import install_data
 
 here = dirname(__file__)
@@ -160,6 +160,19 @@
         ini.write('# Cubicweb cubes directory\n')
         ini.close()
 
+
+class CWDevelop(develop.develop):
+    """Custom "develop" command warning about (legacy) cubes directory not
+    installed.
+    """
+
+    def run(self):
+        cubespath = join(sys.prefix, 'share', 'cubicweb', 'cubes')
+        self.warn('develop command does not install (legacy) cubes directory (%s)'
+                  % cubespath)
+        return super(CWDevelop, self).run()
+
+
 # re-enable copying data files in sys.prefix
 # overwrite MyInstallData to use sys.prefix instead of the egg directory
 MyInstallMoreData = MyInstallData
@@ -247,7 +260,10 @@
             'pyzmq',
         ],
     },
-    cmdclass={'install_lib': MyInstallLib,
-              'install_data': MyInstallData},
+    cmdclass={
+        'install_lib': MyInstallLib,
+        'install_data': MyInstallData,
+        'develop': CWDevelop,
+    },
     zip_safe=False,
 )