summaryrefslogtreecommitdiff
path: root/setuptools/config.py
diff options
context:
space:
mode:
Diffstat (limited to 'setuptools/config.py')
-rw-r--r--setuptools/config.py22
1 files changed, 20 insertions, 2 deletions
diff --git a/setuptools/config.py b/setuptools/config.py
index a04c3ce8..0c88df79 100644
--- a/setuptools/config.py
+++ b/setuptools/config.py
@@ -18,6 +18,12 @@ class ConfigHandler(object):
"""
+ aliases = {}
+ """Options aliases.
+ For compatibility with various packages. E.g.: d2to1 and pbr.
+
+ """
+
strict_mode = True
"""Flag. Whether unknown options in config should
raise DistutilsOptionError exception, or pass silently.
@@ -48,6 +54,9 @@ class ConfigHandler(object):
unknown = tuple()
target_obj = self.target_obj
+ # Translate alias into real name.
+ option_name = self.aliases.get(option_name, option_name)
+
current_value = getattr(target_obj, option_name, unknown)
if current_value is unknown:
@@ -216,9 +225,18 @@ class ConfigHandler(object):
class ConfigMetadataHandler(ConfigHandler):
section_prefix = 'metadata'
+
+ aliases = {
+ 'author-email': 'author_email',
+ 'home_page': 'url',
+ 'summary': 'description',
+ 'classifier': 'classifiers',
+ 'platform': 'platforms',
+ }
+
strict_mode = False
- """We need to keep it loose, to be compatible with `pbr` package
- which also uses `metadata` section.
+ """We need to keep it loose, to be partially compatible with
+ `pbr` and `d2to1` packages which also uses `metadata` section.
"""