File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change 11import argparse
2- import email
32from readme_renderer .markdown import render as render_md
43from readme_renderer .rst import render as render_rst
54from readme_renderer .txt import render as render_txt
65import pathlib
7- from pkg_resources import get_distribution
6+ from importlib . metadata import metadata
87import sys
98from typing import Optional , List
109
@@ -24,14 +23,12 @@ def main(cli_args: Optional[List[str]] = None) -> None:
2423
2524 content_format = args .format
2625 if args .package :
27- distribution = get_distribution (args .input )
28- pkg_info = distribution .get_metadata (distribution .PKG_INFO )
29- message = email .message_from_string (pkg_info )
30- source = message .get_payload ()
26+ message = metadata (args .input )
27+ source = message .get_payload () # type: ignore[attr-defined] # noqa: E501 https://peps.python.org/pep-0566/
3128
3229 # Infer the format of the description from package metadata.
3330 if not content_format :
34- content_type = message .get ("Description-Content-Type" , "text/x-rst" )
31+ content_type = message .get ("Description-Content-Type" , "text/x-rst" ) # type: ignore[attr-defined] # noqa: E501 https://github.com/python/typeshed/issues/10021
3532 if content_type == "text/x-rst" :
3633 content_format = "rst"
3734 elif content_type == "text/markdown" :
You can’t perform that action at this time.
0 commit comments