1
0

dist_info.py 960 B

123456789101112131415161718192021222324252627282930313233343536
  1. """
  2. Create a dist_info directory
  3. As defined in the wheel specification
  4. """
  5. import os
  6. from distutils.core import Command
  7. from distutils import log
  8. class dist_info(Command):
  9. description = 'create a .dist-info directory'
  10. user_options = [
  11. ('egg-base=', 'e', "directory containing .egg-info directories"
  12. " (default: top of the source tree)"),
  13. ]
  14. def initialize_options(self):
  15. self.egg_base = None
  16. def finalize_options(self):
  17. pass
  18. def run(self):
  19. egg_info = self.get_finalized_command('egg_info')
  20. egg_info.egg_base = self.egg_base
  21. egg_info.finalize_options()
  22. egg_info.run()
  23. dist_info_dir = egg_info.egg_info[:-len('.egg-info')] + '.dist-info'
  24. log.info("creating '{}'".format(os.path.abspath(dist_info_dir)))
  25. bdist_wheel = self.get_finalized_command('bdist_wheel')
  26. bdist_wheel.egg2dist(egg_info.egg_info, dist_info_dir)