26 import sys |
26 import sys |
27 import shutil |
27 import shutil |
28 from os.path import dirname, exists, isdir, join |
28 from os.path import dirname, exists, isdir, join |
29 |
29 |
30 from setuptools import setup |
30 from setuptools import setup |
31 from setuptools.command import install_lib |
31 from setuptools.command import develop, install_lib |
32 from distutils.command import install_data |
32 from distutils.command import install_data |
33 |
33 |
34 here = dirname(__file__) |
34 here = dirname(__file__) |
35 |
35 |
36 # import required features |
36 # import required features |
158 path = join(self.install_dir, 'share', 'cubicweb', 'cubes', '__init__.py') |
158 path = join(self.install_dir, 'share', 'cubicweb', 'cubes', '__init__.py') |
159 ini = open(path, 'w') |
159 ini = open(path, 'w') |
160 ini.write('# Cubicweb cubes directory\n') |
160 ini.write('# Cubicweb cubes directory\n') |
161 ini.close() |
161 ini.close() |
162 |
162 |
|
163 |
|
164 class CWDevelop(develop.develop): |
|
165 """Custom "develop" command warning about (legacy) cubes directory not |
|
166 installed. |
|
167 """ |
|
168 |
|
169 def run(self): |
|
170 cubespath = join(sys.prefix, 'share', 'cubicweb', 'cubes') |
|
171 self.warn('develop command does not install (legacy) cubes directory (%s)' |
|
172 % cubespath) |
|
173 return super(CWDevelop, self).run() |
|
174 |
|
175 |
163 # re-enable copying data files in sys.prefix |
176 # re-enable copying data files in sys.prefix |
164 # overwrite MyInstallData to use sys.prefix instead of the egg directory |
177 # overwrite MyInstallData to use sys.prefix instead of the egg directory |
165 MyInstallMoreData = MyInstallData |
178 MyInstallMoreData = MyInstallData |
166 class MyInstallData(MyInstallMoreData): # pylint: disable=E0102 |
179 class MyInstallData(MyInstallMoreData): # pylint: disable=E0102 |
167 """A class that manages data files installation""" |
180 """A class that manages data files installation""" |