@@ -63,9 +63,7 @@ def finalize_options(self):
6363
6464 metadata = self .distribution .metadata
6565
66- basename = "%s-%s.dist-info" % (
67- to_filename (safe_name (metadata ['Name' ])),
68- to_filename (safe_version (metadata ['Version' ])))
66+ basename = metadata .get_fullname (filesafe = True ) + ".dist-info"
6967
7068 self .distinfo_dir = os .path .join (self .distinfo_dir , basename )
7169
@@ -145,31 +143,3 @@ def run(self):
145143
146144 def get_outputs (self ):
147145 return self .outfiles
148-
149-
150- # The following functions are taken from setuptools' pkg_resources module.
151-
152- def safe_name (name ):
153- """Convert an arbitrary string to a standard distribution name
154-
155- Any runs of non-alphanumeric/. characters are replaced with a single '-'.
156- """
157- return re .sub ('[^A-Za-z0-9.]+' , '-' , name )
158-
159-
160- def safe_version (version ):
161- """Convert an arbitrary string to a standard version string
162-
163- Spaces become dots, and all other non-alphanumeric characters become
164- dashes, with runs of multiple dashes condensed to a single dash.
165- """
166- version = version .replace (' ' , '.' )
167- return re .sub ('[^A-Za-z0-9.]+' , '-' , version )
168-
169-
170- def to_filename (name ):
171- """Convert a project or version name to its filename-escaped form
172-
173- Any '-' characters are currently replaced with '_'.
174- """
175- return name .replace ('-' , '_' )
0 commit comments