147 for directory in include_dirs: |
147 for directory in include_dirs: |
148 src = join(modname, directory) |
148 src = join(modname, directory) |
149 dest = join(self.install_dir, src) |
149 dest = join(self.install_dir, src) |
150 export(src, dest, verbose=self.verbose) |
150 export(src, dest, verbose=self.verbose) |
151 |
151 |
152 # write required share/cubicweb/cubes/__init__.py |
152 |
|
153 # re-enable copying data files in sys.prefix |
|
154 # overwrite install_data to use sys.prefix instead of the egg directory |
153 class MyInstallData(install_data.install_data): |
155 class MyInstallData(install_data.install_data): |
154 """A class That manages data files installation""" |
|
155 def run(self): |
|
156 """overridden from install_data class""" |
|
157 install_data.install_data.run(self) |
|
158 path = join(self.install_dir, 'share', 'cubicweb', 'cubes', '__init__.py') |
|
159 ini = open(path, 'w') |
|
160 ini.write('# Cubicweb cubes directory\n') |
|
161 ini.close() |
|
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 develop.develop.run(self) |
|
174 |
|
175 |
|
176 # re-enable copying data files in sys.prefix |
|
177 # overwrite MyInstallData to use sys.prefix instead of the egg directory |
|
178 MyInstallMoreData = MyInstallData |
|
179 class MyInstallData(MyInstallMoreData): # pylint: disable=E0102 |
|
180 """A class that manages data files installation""" |
156 """A class that manages data files installation""" |
181 def run(self): |
157 def run(self): |
182 _old_install_dir = self.install_dir |
158 _old_install_dir = self.install_dir |
183 if self.install_dir.endswith('egg'): |
159 if self.install_dir.endswith('egg'): |
184 self.install_dir = sys.prefix |
160 self.install_dir = sys.prefix |
185 MyInstallMoreData.run(self) |
161 install_data.install_data.run(self) |
186 self.install_dir = _old_install_dir |
162 self.install_dir = _old_install_dir |
187 try: |
163 try: |
188 import setuptools.command.easy_install # only if easy_install available |
164 import setuptools.command.easy_install # only if easy_install available |
189 # monkey patch: Crack SandboxViolation verification |
165 # monkey patch: Crack SandboxViolation verification |
190 from setuptools.sandbox import DirectorySandbox as DS |
166 from setuptools.sandbox import DirectorySandbox as DS |