|
83 | 83 | print_raw, check_for_freetype, check_for_libpng, check_for_gtk, \ |
84 | 84 | check_for_tk, check_for_wx, check_for_numpy, check_for_qt, check_for_qt4, \ |
85 | 85 | check_for_cairo, check_for_traits, check_for_pytz, check_for_dateutil, \ |
86 | | - check_for_configobj |
| 86 | + check_for_configobj, check_for_dvipng, check_for_ghostscript, \ |
| 87 | + check_for_latex, check_for_pdftops, check_for_datetime |
87 | 88 | #import distutils.sysconfig |
88 | 89 |
|
89 | 90 | # jdh |
|
184 | 185 | build_contour(ext_modules, packages) |
185 | 186 | build_nxutils(ext_modules, packages) |
186 | 187 |
|
187 | | -print_raw("") |
188 | | -print_raw("OPTIONAL DEPENDENCIES") |
189 | | - |
190 | | -try: import datetime |
191 | | -except ImportError: hasdatetime = False |
192 | | -else: hasdatetime = True |
193 | | - |
194 | | -if hasdatetime: # dates require python23 datetime |
195 | | - # only install pytz and dateutil if the user hasn't got them |
196 | | - def add_pytz(): |
197 | | - packages.append('pytz') |
198 | | - resources = ['zone.tab', 'locales/pytz.pot'] |
199 | | - # install pytz subdirs |
200 | | - for dirpath, dirname, filenames in os.walk(os.path.join('lib', 'pytz', |
201 | | - 'zoneinfo')): |
202 | | - if '.svn' not in dirpath: |
203 | | - # remove the 'lib/pytz' part of the path |
204 | | - basepath = dirpath.split(os.path.sep, 2)[2] |
205 | | - resources.extend([os.path.join(basepath, filename) |
206 | | - for filename in filenames]) |
207 | | - package_data['pytz'] = resources |
208 | | - assert len(resources) > 10, 'pytz zoneinfo files not found!' |
209 | | -# packages.append('/'.join(dirpath.split(os.sep)[1:])) |
210 | | - |
211 | | - def add_dateutil(): |
212 | | - packages.append('dateutil') |
213 | | - packages.append('dateutil/zoneinfo') |
214 | | - package_data['dateutil'] = ['zoneinfo/zoneinfo*.tar.*'] |
215 | | - |
216 | | - haspytz = check_for_pytz() |
217 | | - hasdateutil = check_for_dateutil() |
218 | | - |
219 | | - if sys.platform=='win32': |
220 | | - # always add these to the win32 installer |
221 | | - add_pytz() |
222 | | - add_dateutil() |
223 | | - else: |
224 | | - # only add them if we need them |
225 | | - if not haspytz: add_pytz() |
226 | | - if not hasdateutil: add_dateutil() |
227 | | - |
228 | 188 | build_swigagg(ext_modules, packages) |
229 | 189 | build_transforms(ext_modules, packages) |
230 | 190 |
|
231 | | -# for the traited config package: |
232 | | -if not check_for_configobj(): py_modules.append('configobj') |
233 | | - |
234 | | -if not check_for_traits(): build_traits(ext_modules, packages) |
| 191 | +print_raw("") |
| 192 | +print_raw("OPTIONAL BACKEND DEPENDENCIES") |
235 | 193 |
|
236 | 194 | if check_for_gtk() and (BUILD_GTK or BUILD_GTKAGG): |
237 | 195 | if BUILD_GTK: |
@@ -278,6 +236,58 @@ def add_dateutil(): |
278 | 236 | if VERBOSE: |
279 | 237 | mod.extra_compile_args.append('-DVERBOSE') |
280 | 238 |
|
| 239 | +print_raw("") |
| 240 | +print_raw("OPTIONAL DATE/TIMEZONE DEPENDENCIES") |
| 241 | + |
| 242 | +hasdatetime = check_for_datetime() |
| 243 | +hasdateutil = check_for_dateutil(hasdatetime) |
| 244 | +haspytz = check_for_pytz(hasdatetime) |
| 245 | + |
| 246 | +if hasdatetime: # dates require python23 datetime |
| 247 | + # only install pytz and dateutil if the user hasn't got them |
| 248 | + |
| 249 | + def add_pytz(): |
| 250 | + packages.append('pytz') |
| 251 | + resources = ['zone.tab', 'locales/pytz.pot'] |
| 252 | + # install pytz subdirs |
| 253 | + for dirpath, dirname, filenames in os.walk(os.path.join('lib', 'pytz', |
| 254 | + 'zoneinfo')): |
| 255 | + if '.svn' not in dirpath: |
| 256 | + # remove the 'lib/pytz' part of the path |
| 257 | + basepath = dirpath.split(os.path.sep, 2)[2] |
| 258 | + resources.extend([os.path.join(basepath, filename) |
| 259 | + for filename in filenames]) |
| 260 | + package_data['pytz'] = resources |
| 261 | + assert len(resources) > 10, 'pytz zoneinfo files not found!' |
| 262 | +# packages.append('/'.join(dirpath.split(os.sep)[1:])) |
| 263 | + |
| 264 | + def add_dateutil(): |
| 265 | + packages.append('dateutil') |
| 266 | + packages.append('dateutil/zoneinfo') |
| 267 | + package_data['dateutil'] = ['zoneinfo/zoneinfo*.tar.*'] |
| 268 | + |
| 269 | + if sys.platform=='win32': |
| 270 | + # always add these to the win32 installer |
| 271 | + add_pytz() |
| 272 | + add_dateutil() |
| 273 | + else: |
| 274 | + # only add them if we need them |
| 275 | + if not haspytz: add_pytz() |
| 276 | + if not hasdateutil: add_dateutil() |
| 277 | + |
| 278 | +print_raw("") |
| 279 | +print_raw("OPTIONAL USETEX DEPENDENCIES") |
| 280 | +check_for_dvipng() |
| 281 | +check_for_ghostscript() |
| 282 | +check_for_latex() |
| 283 | +check_for_pdftops() |
| 284 | + |
| 285 | +# TODO: comment out for mpl release: |
| 286 | +print_raw("") |
| 287 | +print_raw("EXPERIMENTAL CONFIG PACKAGE DEPENDENCIES") |
| 288 | +if not check_for_configobj(): py_modules.append('configobj') |
| 289 | +if not check_for_traits(): build_traits(ext_modules, packages) |
| 290 | + |
281 | 291 | print_raw("") |
282 | 292 | print_raw("[Edit setup.cfg to suppress the above messages]") |
283 | 293 | print_line() |
|
0 commit comments