File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ Retain valid names with underscores in egg_info.
Original file line number Diff line number Diff line change 1212
1313# https://packaging.python.org/en/latest/specifications/core-metadata/#name
1414_VALID_NAME = re .compile (r"^([A-Z0-9]|[A-Z0-9][A-Z0-9._-]*[A-Z0-9])$" , re .I )
15- _UNSAFE_NAME_CHARS = re .compile (r"[^A-Z0-9.]+" , re .I )
15+ _UNSAFE_NAME_CHARS = re .compile (r"[^A-Z0-9._- ]+" , re .I )
1616_NON_ALPHANUMERIC = re .compile (r"[^A-Z0-9]+" , re .I )
1717_PEP440_FALLBACK = re .compile (r"^v?(?P<safe>(?:[0-9]+!)?[0-9]+(?:\.[0-9]+)*)" , re .I )
1818
@@ -35,6 +35,8 @@ def safe_name(component: str) -> str:
3535 'hello-world'
3636 >>> safe_name("hello?world")
3737 'hello-world'
38+ >>> safe_name("hello_world")
39+ 'hello_world'
3840 """
3941 # See pkg_resources.safe_name
4042 return _UNSAFE_NAME_CHARS .sub ("-" , component )
You can’t perform that action at this time.
0 commit comments