| 285 | |
| 286 | |
| 287 | class cleaner(clean): |
| 288 | |
| 289 | def run(self): |
| 290 | # Recursive deletion of build/ directory |
| 291 | path = localpath('build') |
| 292 | try: |
| 293 | shutil.rmtree(path) |
| 294 | except Exception: |
| 295 | debug('Failed to remove directory %s' % path) |
| 296 | else: |
| 297 | debug('Cleaned up %s' % path) |
| 298 | |
| 299 | # Now, the extension and other files |
| 300 | try: |
| 301 | import imp |
| 302 | except ImportError: |
| 303 | if os.name == 'posix': |
| 304 | # RAM: with Python 3 the lib is now versioned. |
| 305 | paths = [localpath('numexpr/interpreter.so')] |
| 306 | else: |
| 307 | paths = [localpath('numexpr/interpreter.pyd')] |
| 308 | else: |
| 309 | paths = [] |
| 310 | for suffix, _, _ in imp.get_suffixes(): |
| 311 | if suffix == '.py': |
| 312 | continue |
| 313 | paths.append(localpath('numexpr3', 'interpreter' + suffix)) |
| 314 | paths.append(localpath('numexpr3/__config__.py')) |
| 315 | paths.append(localpath('numexpr3/__config__.pyc')) |
| 316 | for path in paths: |
| 317 | try: |
| 318 | os.remove(path) |
| 319 | except Exception: |
| 320 | debug('Failed to clean up file %s' % path) |
| 321 | else: |
| 322 | debug('Cleaning up %s' % path) |
| 323 | |
| 324 | clean.run(self) |
| 325 | |
| 326 | class build_ext(numpy_build_ext): |
| 327 | ''' Builds the interpreter shared/dynamic library.''' |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…