[Python-checkins] distutils2: Don't check twice the same thing (restructured text compatibility).
tarek.ziade
python-checkins at python.org
Wed Feb 16 22:23:56 CET 2011
tarek.ziade pushed d355f123ac79 to distutils2:
http://hg.python.org/distutils2/rev/d355f123ac79
changeset: 1000:d355f123ac79
user: Alexis Metaireau <alexis at notmyidea.org>
date: Tue Feb 01 16:15:32 2011 +0000
summary:
Don't check twice the same thing (restructured text compatibility).
Add a note in DEVNOTES to be sure all tests are really runned (and not skipped cause of docutils)
files:
DEVNOTES.txt
distutils2/command/check.py
distutils2/metadata.py
diff --git a/DEVNOTES.txt b/DEVNOTES.txt
--- a/DEVNOTES.txt
+++ b/DEVNOTES.txt
@@ -6,4 +6,5 @@
one of these Python versions.
- Always run tests.sh before you push a change. This implies
- that you have all Python versions installed from 2.4 to 2.7.
+ that you have all Python versions installed from 2.4 to 2.7. Be sure to have
+ docutils installed on all python versions no avoid skipping tests as well.
diff --git a/distutils2/command/check.py b/distutils2/command/check.py
--- a/distutils2/command/check.py
+++ b/distutils2/command/check.py
@@ -64,7 +64,7 @@
def check_restructuredtext(self):
"""Checks if the long string fields are reST-compliant."""
- missing, warnings = self.distribution.metadata.check()
+ missing, warnings = self.distribution.metadata.check(restructuredtext=True)
if self.distribution.metadata.docutils_support:
for warning in warnings:
line = warning[-1].get('line')
diff --git a/distutils2/metadata.py b/distutils2/metadata.py
--- a/distutils2/metadata.py
+++ b/distutils2/metadata.py
@@ -465,7 +465,7 @@
return None
return value
- def check(self, strict=False):
+ def check(self, strict=False, restructuredtext=False):
"""Check if the metadata is compliant. If strict is False then raise if
no Name or Version are provided"""
# XXX should check the versions (if the file was loaded)
@@ -483,7 +483,7 @@
if attr not in self:
missing.append(attr)
- if _HAS_DOCUTILS:
+ if _HAS_DOCUTILS and restructuredtext:
warnings.extend(self._check_rst_data(self['Description']))
# checking metadata 1.2 (XXX needs to check 1.1, 1.0)
--
Repository URL: http://hg.python.org/distutils2
More information about the Python-checkins
mailing list