Show More
@@ -58,6 +58,7 b' from setupbase import (' | |||||
58 | setup_args, |
|
58 | setup_args, | |
59 | find_packages, |
|
59 | find_packages, | |
60 | find_package_data, |
|
60 | find_package_data, | |
|
61 | check_package_data_first, | |||
61 | find_entry_points, |
|
62 | find_entry_points, | |
62 | build_scripts_entrypt, |
|
63 | build_scripts_entrypt, | |
63 | find_data_files, |
|
64 | find_data_files, | |
@@ -191,6 +192,7 b" if len(sys.argv) >= 2 and sys.argv[1] in ('sdist','bdist_rpm'):" | |||||
191 |
|
192 | |||
192 | packages = find_packages() |
|
193 | packages = find_packages() | |
193 | package_data = find_package_data() |
|
194 | package_data = find_package_data() | |
|
195 | ||||
194 | data_files = find_data_files() |
|
196 | data_files = find_data_files() | |
195 |
|
197 | |||
196 | setup_args['packages'] = packages |
|
198 | setup_args['packages'] = packages | |
@@ -224,7 +226,7 b' class UploadWindowsInstallers(upload):' | |||||
224 | self.upload_file('bdist_wininst', 'any', dist_file) |
|
226 | self.upload_file('bdist_wininst', 'any', dist_file) | |
225 |
|
227 | |||
226 | setup_args['cmdclass'] = { |
|
228 | setup_args['cmdclass'] = { | |
227 | 'build_py': git_prebuild('IPython'), |
|
229 | 'build_py': check_package_data_first(git_prebuild('IPython')), | |
228 | 'sdist' : git_prebuild('IPython', sdist), |
|
230 | 'sdist' : git_prebuild('IPython', sdist), | |
229 | 'upload_wininst' : UploadWindowsInstallers, |
|
231 | 'upload_wininst' : UploadWindowsInstallers, | |
230 | 'submodule' : UpdateSubmodules, |
|
232 | 'submodule' : UpdateSubmodules, |
@@ -188,7 +188,12 b' def find_package_data():' | |||||
188 | 'IPython.nbformat' : ['tests/*.ipynb'] |
|
188 | 'IPython.nbformat' : ['tests/*.ipynb'] | |
189 | } |
|
189 | } | |
190 |
|
190 | |||
191 | # verify that package_data makes sense |
|
191 | return package_data | |
|
192 | ||||
|
193 | ||||
|
194 | def check_package_data(package_data): | |||
|
195 | """verify that package_data globs make sense""" | |||
|
196 | print("checking package data") | |||
192 | for pkg, data in package_data.items(): |
|
197 | for pkg, data in package_data.items(): | |
193 | pkg_root = pjoin(*pkg.split('.')) |
|
198 | pkg_root = pjoin(*pkg.split('.')) | |
194 | for d in data: |
|
199 | for d in data: | |
@@ -198,7 +203,17 b' def find_package_data():' | |||||
198 | else: |
|
203 | else: | |
199 | assert os.path.exists(path), "Missing package data: %s" % path |
|
204 | assert os.path.exists(path), "Missing package data: %s" % path | |
200 |
|
205 | |||
201 | return package_data |
|
206 | ||
|
207 | def check_package_data_first(command): | |||
|
208 | """decorator for checking package_data before running a given command | |||
|
209 | ||||
|
210 | Probably only needs to wrap build_py | |||
|
211 | """ | |||
|
212 | class DecoratedCommand(command): | |||
|
213 | def run(self): | |||
|
214 | check_package_data(self.package_data) | |||
|
215 | command.run(self) | |||
|
216 | return DecoratedCommand | |||
202 |
|
217 | |||
203 |
|
218 | |||
204 | #--------------------------------------------------------------------------- |
|
219 | #--------------------------------------------------------------------------- |
General Comments 0
You need to be logged in to leave comments.
Login now