diff options
Diffstat (limited to 'setuptools/command/egg_info.py')
-rwxr-xr-x | setuptools/command/egg_info.py | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py index 9ccbe68f..124c410e 100755 --- a/setuptools/command/egg_info.py +++ b/setuptools/command/egg_info.py @@ -163,7 +163,12 @@ class egg_info(Command): os.unlink(filename) def tagged_version(self): - return safe_version(self.distribution.get_version() + self.vtags) + version = self.distribution.get_version() + # egg_info may be called more than once for a distribution, + # in which case the version string already contains all tags. + if self.vtags and version.endswith(self.vtags): + return safe_version(version) + return safe_version(version + self.vtags) def run(self): self.mkpath(self.egg_info) @@ -288,6 +293,19 @@ class FileList(FileList): +def compose(path): + # Apple's HFS Plus returns decomposed UTF-8. Since just about + # everyone else chokes on it, we must make sure to return fully + # composed UTF-8 only. + if sys.getfilesystemencoding().lower() == 'utf-8': + from unicodedata import normalize + if sys.version_info >= (3,): + path = normalize('NFC', path) + else: + path = normalize('NFC', path.decode('utf-8')).encode('utf-8') + return path + + class manifest_maker(sdist): template = "MANIFEST.in" @@ -312,6 +330,7 @@ class manifest_maker(sdist): self.prune_file_list() self.filelist.sort() self.filelist.remove_duplicates() + self.filelist.files = [compose(path) for path in self.filelist.files] self.write_manifest() def write_manifest (self): |