Wrap a setup command Parameters ---------- cmds: list(str) The names of the other commands to run prior to the command. strict: boolean, optional Wether to raise errors when a pre-command fails.
(cmds, cls, strict=True)
| 459 | |
| 460 | |
| 461 | def _wrap_command(cmds, cls, strict=True): |
| 462 | """Wrap a setup command |
| 463 | |
| 464 | Parameters |
| 465 | ---------- |
| 466 | cmds: list(str) |
| 467 | The names of the other commands to run prior to the command. |
| 468 | strict: boolean, optional |
| 469 | Wether to raise errors when a pre-command fails. |
| 470 | """ |
| 471 | class WrappedCommand(cls): |
| 472 | |
| 473 | def run(self): |
| 474 | if not getattr(self, 'uninstall', None): |
| 475 | try: |
| 476 | [self.run_command(cmd) for cmd in cmds] |
| 477 | except Exception: |
| 478 | if strict: |
| 479 | raise |
| 480 | else: |
| 481 | pass |
| 482 | # update package data |
| 483 | update_package_data(self.distribution) |
| 484 | |
| 485 | result = cls.run(self) |
| 486 | return result |
| 487 | return WrappedCommand |
| 488 | |
| 489 | |
| 490 | def _get_file_handler(package_data_spec, data_files_spec): |
nothing calls this directly
no outgoing calls
no test coverage detected