[Python-checkins] distutils2: [mq]: core.py, dist.py modified to include use_2to3, convert_2to3_doctests
tarek.ziade
python-checkins at python.org
Sun Jul 4 11:16:45 CEST 2010
tarek.ziade pushed 961a8257a8b9 to distutils2:
http://hg.python.org/distutils2/rev/961a8257a8b9
changeset: 252:961a8257a8b9
user: Zubin Mithra <zubin.mithra at gmail.com>
date: Sun Jul 04 02:44:25 2010 +0530
summary: [mq]: core.py, dist.py modified to include use_2to3, convert_2to3_doctests
files: src/distutils2/core.py, src/distutils2/dist.py
diff --git a/src/distutils2/core.py b/src/distutils2/core.py
--- a/src/distutils2/core.py
+++ b/src/distutils2/core.py
@@ -49,7 +49,8 @@
'maintainer', 'maintainer_email', 'url', 'license',
'description', 'long_description', 'keywords',
'platforms', 'classifiers', 'download_url',
- 'requires', 'provides', 'obsoletes',
+ 'requires', 'provides', 'obsoletes', 'use_2to3',
+ 'convert_2to3_doctests',
)
# Legal keyword arguments for the Extension constructor
diff --git a/src/distutils2/dist.py b/src/distutils2/dist.py
--- a/src/distutils2/dist.py
+++ b/src/distutils2/dist.py
@@ -112,7 +112,11 @@
('requires', None,
"print the list of packages/modules required"),
('obsoletes', None,
- "print the list of packages/modules made obsolete")
+ "print the list of packages/modules made obsolete"),
+ ('use-2to3', None,
+ "use 2to3 to make source python 3.x compatible"),
+ ('convert-2to3-doctests', None,
+ "use 2to3 to convert doctests in seperate text files"),
]
display_option_names = map(lambda x: translate_longopt(x[0]),
display_options)
@@ -206,6 +210,8 @@
self.scripts = None
self.data_files = None
self.password = ''
+ self.use_2to3 = False
+ self.convert_2to3_doctests = []
# And now initialize bookkeeping stuff that can't be supplied by
# the caller at all. 'command_obj' maps command names to
@@ -581,15 +587,11 @@
instance, analogous to the .finalize_options() method of Command
objects.
"""
-
- # XXX conversion -- removed
- #for attr in ('keywords', 'platforms'):
- # value = self.metadata.get_field(attr)
- # if value is None:
- # continue
- # if isinstance(value, str):
- # value = [elm.strip() for elm in value.split(',')]
- # setattr(self.metadata, attr, value)
+ if getattr(self, 'convert_2to3_doctests', None):
+ self.convert_2to3_doctests = [os.path.join(p)
+ for p in self.convert_2to3_doctests]
+ else:
+ self.convert_2to3_doctests = []
def _show_help(self, parser, global_options=1, display_options=1,
commands=[]):
--
Repository URL: http://hg.python.org/distutils2
More information about the Python-checkins
mailing list