You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
750 B

  1. """Do X and Y."""
  2. from packaging import logger
  3. from packaging.command.cmd import Command
  4. class x(Command):
  5. # Brief (40-50 characters) description of the command
  6. description = ""
  7. # List of option tuples: long name, short name (None if no short
  8. # name), and help string.
  9. user_options = [
  10. ('', '', # long option, short option (one letter) or None
  11. ""), # help text
  12. ]
  13. def initialize_options(self):
  14. self. = None
  15. self. = None
  16. self. = None
  17. def finalize_options(self):
  18. if self.x is None:
  19. self.x = ...
  20. def run(self):
  21. ...
  22. logger.info(...)
  23. if not self.dry_run:
  24. ...
  25. self.execute(..., dry_run=self.dry_run)