diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2020-09-23 17:26:24 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2020-09-23 17:26:34 -0400 |
commit | 8cca69b8ffd372ce5e3089cebbdbf92c071f3761 (patch) | |
tree | 6300de4fda7c64f81ecc98e54c1ca3e3ea9bd5d5 /setuptools/command/egg_info.py | |
parent | f852d1598a7814f5f4f6e8bf26d3d60cffe1798a (diff) | |
parent | 662816b65fbbfaf4e8ff523e39a6034785a4d8eb (diff) | |
download | python-setuptools-git-feature/2093-docs-revamp.tar.gz |
Merge branch 'master' into feature/2093-docs-revampfeature/2093-docs-revamp
Diffstat (limited to 'setuptools/command/egg_info.py')
-rw-r--r-- | setuptools/command/egg_info.py | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py index 7fa89541..c957154a 100644 --- a/setuptools/command/egg_info.py +++ b/setuptools/command/egg_info.py @@ -16,9 +16,6 @@ import warnings import time import collections -from setuptools.extern import six -from setuptools.extern.six.moves import map - from setuptools import Command from setuptools.command.sdist import sdist from setuptools.command.sdist import walk_revctrl @@ -208,11 +205,11 @@ class egg_info(InfoCommon, Command): list( parse_requirements(spec % (self.egg_name, self.egg_version)) ) - except ValueError: + except ValueError as e: raise distutils.errors.DistutilsOptionError( "Invalid distribution name or version syntax: %s-%s" % (self.egg_name, self.egg_version) - ) + ) from e if self.egg_base is None: dirs = self.distribution.package_dir @@ -267,8 +264,7 @@ class egg_info(InfoCommon, Command): to the file. """ log.info("writing %s to %s", what, filename) - if not six.PY2: - data = data.encode("utf-8") + data = data.encode("utf-8") if not self.dry_run: f = open(filename, 'wb') f.write(data) @@ -647,7 +643,7 @@ def _write_requirements(stream, reqs): def write_requirements(cmd, basename, filename): dist = cmd.distribution - data = six.StringIO() + data = io.StringIO() _write_requirements(data, dist.install_requires) extras_require = dist.extras_require or {} for extra in sorted(extras_require): @@ -687,12 +683,12 @@ def write_arg(cmd, basename, filename, force=False): def write_entries(cmd, basename, filename): ep = cmd.distribution.entry_points - if isinstance(ep, six.string_types) or ep is None: + if isinstance(ep, str) or ep is None: data = ep elif ep is not None: data = [] for section, contents in sorted(ep.items()): - if not isinstance(contents, six.string_types): + if not isinstance(contents, str): contents = EntryPoint.parse_group(section, contents) contents = '\n'.join(sorted(map(str, contents.values()))) data.append('[%s]\n%s\n\n' % (section, contents)) |