Guest User

Untitled

a guest
Sep 13th, 2023
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. (Pdb) print(indexer.query("def normalize_dist_name(name: str, version: str) -> str:"))
  2. return True
  3.  
  4. def make_metadata(module, ini_info):
  5. md_dict = {'name': module.name, 'provides': [module.name]}
  6. md_dict.update(get_info_from_module(module, ini_info.dynamic_metadata))
  7. md_dict.update(ini_info.metadata)
  8. return Metadata(md_dict)
  9.  
  10. def normalize_dist_name(name: str, version: str) -> str:
  11. """Normalizes a name and a PEP 440 version
  12.  
  13. The resulting string is valid as dist-info folder name
  14. and as first part of a wheel filename
  15.  
  16. See https://packaging.python.org/specifications/binary-distribution-format/#escaping-and-unicode
  17. """
  18. normalized_name = re.sub(r'[-_.]+', '_', name, flags=re.UNICODE).lower()
  19. assert check_version(version) == version
  20. assert '-' not in version, 'Normalized versions can’t have dashes'
  21. return '{}-{}'.format(normalized_name, version)
  22.  
  23.  
  24. def dist_info_name(distribution, version):
  25. """Get the correct name of the .dist-info folder"""
  26. return normalize_dist_name(distribution, version) + '.dist-info'
Advertisement
Add Comment
Please, Sign In to add comment