Commit 31e756c3 authored by Denis Laxalde's avatar Denis Laxalde
Browse files

[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.
parent b77c82355325
...@@ -28,7 +28,7 @@ import shutil ...@@ -28,7 +28,7 @@ import shutil
from os.path import dirname, exists, isdir, join from os.path import dirname, exists, isdir, join
from setuptools import setup from setuptools import setup
from setuptools.command import install_lib from setuptools.command import develop, install_lib
from distutils.command import install_data from distutils.command import install_data
here = dirname(__file__) here = dirname(__file__)
...@@ -160,6 +160,19 @@ class MyInstallData(install_data.install_data): ...@@ -160,6 +160,19 @@ class MyInstallData(install_data.install_data):
ini.write('# Cubicweb cubes directory\n') ini.write('# Cubicweb cubes directory\n')
ini.close() 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 # re-enable copying data files in sys.prefix
# overwrite MyInstallData to use sys.prefix instead of the egg directory # overwrite MyInstallData to use sys.prefix instead of the egg directory
MyInstallMoreData = MyInstallData MyInstallMoreData = MyInstallData
...@@ -247,7 +260,10 @@ setup( ...@@ -247,7 +260,10 @@ setup(
'pyzmq', 'pyzmq',
], ],
}, },
cmdclass={'install_lib': MyInstallLib, cmdclass={
'install_data': MyInstallData}, 'install_lib': MyInstallLib,
'install_data': MyInstallData,
'develop': CWDevelop,
},
zip_safe=False, zip_safe=False,
) )
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment