aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--setuptools/config.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/setuptools/config.py b/setuptools/config.py
index 73a3bf70..4cc1cb38 100644
--- a/setuptools/config.py
+++ b/setuptools/config.py
@@ -110,7 +110,8 @@ def parse_configuration(
options.parse()
meta = ConfigMetadataHandler(
- distribution.metadata, command_options, ignore_option_errors, distribution.package_dir)
+ distribution.metadata, command_options, ignore_option_errors,
+ distribution.package_dir)
meta.parse()
return meta, options
@@ -458,9 +459,12 @@ class ConfigMetadataHandler(ConfigHandler):
# Be strict about versions loaded from file because it's easy to
# accidentally include newlines and other unintended content
if isinstance(parse(version), LegacyVersion):
- raise DistutilsOptionError('Version loaded from %s does not comply with PEP 440: %s' % (
- value, version
- ))
+ tmpl = (
+ 'Version loaded from {value} does not '
+ 'comply with PEP 440: {version}'
+ )
+ raise DistutilsOptionError(tmpl.format(**locals()))
+
return version
version = self._parse_attr(value, self.package_dir)
@@ -518,12 +522,13 @@ class ConfigOptionsHandler(ConfigHandler):
find_directives = ['find:', 'find_namespace:']
trimmed_value = value.strip()
- if not trimmed_value in find_directives:
+ if trimmed_value not in find_directives:
return self._parse_list(value)
findns = trimmed_value == find_directives[1]
if findns and not PY3:
- raise DistutilsOptionError('find_namespace: directive is unsupported on Python < 3.3')
+ raise DistutilsOptionError(
+ 'find_namespace: directive is unsupported on Python < 3.3')
# Read function arguments from a dedicated section.
find_kwargs = self.parse_section_packages__find(