Commits

Pierre-Yves David committed cc75ed2 Merge

merge upstream into resources branches

  • Participants
  • Parent commits b6ad6f9, 1d1d07e

Comments (0)

Files changed (22)

 - Issue #10409: Fixed the Licence selector in mkcfg [tarek]
 - Issue #9558: Fix build_ext with VS 8.0 [éric]
 - Issue #6007: Add disclaimer about MinGW compatibility in docs [éric]
+- Renamed DistributionMetadata to Metadata [ccomb]
 
 1.0a3 - 2010-10-08
 ------------------
 
 See the documentation at http://packages.python.org/Distutils2 for more info.
 
+If you want to contribute, please have a look to 
+http://distutils2.notmyidea.org/contributing.html
+
 **Beware that Distutils2 is in its early stage and should not be used in
 production. Its API is subject to changes**
 

File distutils2/_backport/pkgutil.py

     from md5 import md5
 
 from distutils2.errors import DistutilsError
-from distutils2.metadata import DistributionMetadata
+from distutils2.metadata import Metadata
 from distutils2.version import suggest_normalized_version, VersionPredicate
 try:
     import cStringIO as StringIO
     name = ''
     """The name of the distribution."""
     metadata = None
-    """A :class:`distutils2.metadata.DistributionMetadata` instance loaded with
+    """A :class:`distutils2.metadata.Metadata` instance loaded with
     the distribution's ``METADATA`` file."""
     requested = False
     """A boolean that indicates whether the ``REQUESTED`` metadata file is
             self.metadata = _cache_path[path].metadata
         else:
             metadata_path = os.path.join(path, 'METADATA')
-            self.metadata = DistributionMetadata(path=metadata_path)
+            self.metadata = Metadata(path=metadata_path)
 
         self.path = path
         self.name = self.metadata['name']
     name = ''
     """The name of the distribution."""
     metadata = None
-    """A :class:`distutils2.metadata.DistributionMetadata` instance loaded with
+    """A :class:`distutils2.metadata.Metadata` instance loaded with
     the distribution's ``METADATA`` file."""
     _REQUIREMENT = re.compile(\
                               r'(?P<name>[-A-Za-z0-9_.]+)\s*' \
         if path.endswith('.egg'):
             if os.path.isdir(path):
                 meta_path = os.path.join(path, 'EGG-INFO', 'PKG-INFO')
-                self.metadata = DistributionMetadata(path=meta_path)
+                self.metadata = Metadata(path=meta_path)
                 try:
                     req_path = os.path.join(path, 'EGG-INFO', 'requires.txt')
                     requires = open(req_path, 'r').read()
                 # FIXME handle the case where zipfile is not available
                 zipf = zipimport.zipimporter(path)
                 fileobj = StringIO.StringIO(zipf.get_data('EGG-INFO/PKG-INFO'))
-                self.metadata = DistributionMetadata(fileobj=fileobj)
+                self.metadata = Metadata(fileobj=fileobj)
                 try:
                     requires = zipf.get_data('EGG-INFO/requires.txt')
                 except IOError:
                     requires = req_f.read()
                 except IOError:
                     requires = None
-            self.metadata = DistributionMetadata(path=path)
+            self.metadata = Metadata(path=path)
             self.name = self.metadata['name']
         else:
             raise ValueError('The path must end with .egg-info or .egg')

File distutils2/_backport/shutil.py

     archive that is being built. If not provided, the current owner and group
     will be used.
 
-    The output tar file will be named 'base_dir' +  ".tar", possibly plus
+    The output tar file will be named 'base_name' +  ".tar", possibly plus
     the appropriate compression extension (".gz", or ".bz2").
 
     Returns the output filename.
 def _make_zipfile(base_name, base_dir, verbose=0, dry_run=0, logger=None):
     """Create a zip file from all the files under 'base_dir'.
 
-    The output zip file will be named 'base_dir' + ".zip".  Uses either the
+    The output zip file will be named 'base_name' + ".zip".  Uses either the
     "zipfile" Python module (if available) or the InfoZIP "zip" utility
     (if installed and found on the default search path).  If neither tool is
     available, raises ExecError.  Returns the name of the output zip

File distutils2/_backport/tests/test_pkgutil.py

     from distutils2._backport.hashlib import md5
 
 from distutils2.errors import DistutilsError
-from distutils2.metadata import DistributionMetadata
+from distutils2.metadata import Metadata
 from distutils2.tests import unittest, run_unittest, support
 
 from distutils2._backport import pkgutil
         dist = Distribution(dist_path)
 
         self.assertEqual(dist.name, name)
-        self.assertTrue(isinstance(dist.metadata, DistributionMetadata))
+        self.assertTrue(isinstance(dist.metadata, Metadata))
         self.assertEqual(dist.metadata['version'], version)
         self.assertTrue(isinstance(dist.requested, type(bool())))
 

File distutils2/command/cmd.py

 from distutils2.errors import DistutilsOptionError
 from distutils2 import util
 from distutils2 import logger
-
-# XXX see if we want to backport this
-from distutils2._backport.shutil import copytree, copyfile, move
-
-try:
-    from shutil import make_archive
-except ImportError:
-    from distutils2._backport.shutil import make_archive
+from distutils2._backport.shutil import copytree, copyfile, move, make_archive
 
 
 class Command(object):

File distutils2/dist.py

 from distutils2.fancy_getopt import FancyGetopt
 from distutils2.util import strtobool, resolve_name
 from distutils2 import logger
-from distutils2.metadata import DistributionMetadata
+from distutils2.metadata import Metadata
 from distutils2.config import Config
 from distutils2.command import get_command_class
 
         # forth) in a separate object -- we're getting to have enough
         # information here (and enough command-line options) that it's
         # worth it.
-        self.metadata = DistributionMetadata()
+        self.metadata = Metadata()
 
         # 'cmdclass' maps command names to class objects, so we
         # can 1) quickly figure out which class to instantiate when

File distutils2/index/dist.py

                                      CantParseArchiveName)
 from distutils2.version import (suggest_normalized_version, NormalizedVersion,
                                 get_version_predicate)
-from distutils2.metadata import DistributionMetadata
+from distutils2.metadata import Metadata
 from distutils2.util import splitext
 
 __all__ = ['ReleaseInfo', 'DistInfo', 'ReleasesList', 'get_infos_from_url']
         self._version = None
         self.version = version
         if metadata:
-            self.metadata = DistributionMetadata(mapping=metadata)
+            self.metadata = Metadata(mapping=metadata)
         else:
             self.metadata = None
         self.dists = {}
 
     def set_metadata(self, metadata):
         if not self.metadata:
-            self.metadata = DistributionMetadata()
+            self.metadata = Metadata()
         self.metadata.update(metadata)
 
     def __getitem__(self, item):
     __hash__ = object.__hash__
 
 
-
 class DistInfo(IndexReference):
     """Represents a distribution retrieved from an index (sdist, bdist, ...)
     """
             return "<? ? %s>" % self.dist_type
 
         return "<%s %s %s>" % (
-                self.release.name, self.release.version, self.dist_type or "")
+            self.release.name, self.release.version, self.dist_type or "")
 
 
 class ReleasesList(IndexReference):

File distutils2/index/simple.py

                                      UnableToDownload, CantParseArchiveName,
                                      ReleaseNotFound, ProjectNotFound)
 from distutils2.index.mirrors import get_mirrors
-from distutils2.metadata import DistributionMetadata
+from distutils2.metadata import Metadata
 from distutils2.version import get_version_predicate
 from distutils2 import __version__ as __distutils2_version__
 
         if not release._metadata:
             location = release.get_distribution().unpack()
             pkg_info = os.path.join(location, 'PKG-INFO')
-            release._metadata = DistributionMetadata(pkg_info)
+            release._metadata = Metadata(pkg_info)
         return release
 
     def _switch_to_next_mirror(self):

File distutils2/metadata.py

     _HAS_DOCUTILS = False
 
 # public API of this module
-__all__ = ('DistributionMetadata', 'PKG_INFO_ENCODING',
+__all__ = ('Metadata', 'PKG_INFO_ENCODING',
            'PKG_INFO_PREFERRED_VERSION')
 
 # Encoding used for the PKG-INFO files
 
 _MISSING = NoDefault()
 
-class DistributionMetadata(object):
+class Metadata(object):
     """The metadata of a release.
 
     Supports versions 1.0, 1.1 and 1.2 (auto-detected). You can

File distutils2/mkcfg.py

 
 import os
 import sys
+import glob
 import re
 import shutil
-import glob
-import re
 from ConfigParser import RawConfigParser
 from textwrap import dedent
-if sys.version_info[:2] < (2, 6):
-    from sets import Set as set
 try:
     from hashlib import md5
 except ImportError:
-    from md5 import md5
+    from distutils2._backport.hashlib  import md5
 # importing this with an underscore as it should be replaced by the
 # dict form or another structures for all purposes
 from distutils2._trove import all_classifiers as _CLASSIFIERS_LIST
 Optionally, you can set other trove identifiers for things such as the
 human language, programming language, user interface, etc...
 ''',
-    'setup.py found':'''
+    'setup.py found': '''
 The setup.py script will be executed to retrieve the metadata.
 A wizard will be run if you answer "n",
-'''
+''',
 }
 
 # XXX everything needs docstrings and tests (both low-level tests of various
 
 CLASSIFIERS = _build_classifiers_dict(_CLASSIFIERS_LIST)
 
+
 def _build_licences(classifiers):
     res = []
     for index, item in enumerate(classifiers):
 
 LICENCES = _build_licences(_CLASSIFIERS_LIST)
 
+
 class MainProgram(object):
     def __init__(self):
         self.configparser = None
             if ans != 'y':
                 return
 
-        #_______mock setup start
         data = self.data
+
         def setup(**attrs):
             """Mock the setup(**attrs) in order to retrive metadata."""
             # use the distutils v1 processings to correctly parse metadata.
                 if len(dist.data_files) < 2 or \
                    isinstance(dist.data_files[1], str):
                     dist.data_files = [('', dist.data_files)]
-                #add tokens in the destination paths
-                vars = {'distribution.name':data['name']}
+                # add tokens in the destination paths
+                vars = {'distribution.name': data['name']}
                 path_tokens = sysconfig.get_paths(vars=vars).items()
-                #sort tokens to use the longest one first
-                path_tokens.sort(cmp=lambda x,y: cmp(len(y), len(x)),
+                # sort tokens to use the longest one first
+                # TODO chain two sorted with key arguments, remove cmp
+                path_tokens.sort(cmp=lambda x, y: cmp(len(y), len(x)),
                                  key=lambda x: x[1])
                 for dest, srcs in (dist.data_files or []):
                     dest = os.path.join(sys.prefix, dest)
             package_dirs = dist.package_dir or {}
             for package, extras in dist.package_data.iteritems() or []:
                 package_dir = package_dirs.get(package, package)
-                fils = [os.path.join(package_dir, fil) for fil in extras]
-                data['extra_files'].extend(fils)
+                files = [os.path.join(package_dir, f) for f in extras]
+                data['extra_files'].extend(files)
 
             # Use README file if its content is the desciption
             if "description" in data:
                 ref = md5(re.sub('\s', '', self.data['description']).lower())
                 ref = ref.digest()
                 for readme in glob.glob('README*'):
-                    fob = open(readme)
-                    val = md5(re.sub('\s', '', fob.read()).lower()).digest()
-                    fob.close()
+                    fp = open(readme)
+                    try:
+                        contents = fp.read()
+                    finally:
+                        fp.close()
+                    val = md5(re.sub('\s', '', contents.lower())).digest()
                     if val == ref:
                         del data['description']
                         data['description-file'] = readme
                         break
-        #_________ mock setup end
 
         # apply monkey patch to distutils (v1) and setuptools (if needed)
         # (abord the feature if distutils v1 has been killed)
         try:
             import distutils.core as DC
-            getattr(DC, 'setup') # ensure distutils v1
-        except ImportError, AttributeError:
+            DC.setup  # ensure distutils v1
+        except (ImportError, AttributeError):
             return
         saved_setups = [(DC, DC.setup)]
         DC.setup = setup
             import setuptools
             saved_setups.append((setuptools, setuptools.setup))
             setuptools.setup = setup
-        except ImportError, AttributeError:
+        except (ImportError, AttributeError):
             pass
         # get metadata by executing the setup.py with the patched setup(...)
-        success = False # for python < 2.4
+        success = False  # for python < 2.4
         try:
             pyenv = globals().copy()
             execfile(setuppath, pyenv)
             success = True
-        finally: #revert monkey patches
+        finally:  # revert monkey patches
             for patched_module, original_setup in saved_setups:
                 patched_module.setup = original_setup
         if not self.data:
     def inspect_file(self, path):
         fp = open(path, 'r')
         try:
-            for line in [fp.readline() for _ in range(10)]:
+            for _ in xrange(10):
+                line = fp.readline()
                 m = re.match(r'^#!.*python((?P<major>\d)(\.\d+)?)?$', line)
                 if m:
                     if m.group('major') == '3':
                         helptext=_helptext['extra_files']) == 'y':
                 self._set_multi('Extra file/dir name', 'extra_files')
 
-
         if ask_yn('Do you want to set Trove classifiers?',
                   helptext=_helptext['do_classifier']) == 'y':
             self.set_classifier()
         _pref = ['lib', 'include', 'dist', 'build', '.', '~']
         _suf = ['.pyc']
 
-
         def to_skip(path):
             path = relative(path)
 

File distutils2/tests/test_command_install_distinfo.py

 
 from distutils2.command.install_distinfo import install_distinfo
 from distutils2.command.cmd import Command
-from distutils2.metadata import DistributionMetadata
+from distutils2.metadata import Metadata
 from distutils2.tests import unittest, support
 
 try:
         self.assertEqual(open(os.path.join(dist_info, 'REQUESTED')).read(),
                          '')
         meta_path = os.path.join(dist_info, 'METADATA')
-        self.assertTrue(DistributionMetadata(path=meta_path).check())
+        self.assertTrue(Metadata(path=meta_path).check())
 
     def test_installer(self):
         pkg_dir, dist = self.create_dist(name='foo',

File distutils2/tests/test_command_test.py

 from distutils2.dist import Distribution
 from distutils2._backport import pkgutil
 
-try:
-    any
-except NameError:
-    from distutils2._backport import any
 
 EXPECTED_OUTPUT_RE = r'''FAIL: test_blah \(myowntestmodule.SomeTest\)
 ----------------------------------------------------------------------

File distutils2/tests/test_dist.py

             distutils2.dist.DEBUG = False
 
     def test_write_pkg_file(self):
-        # Check DistributionMetadata handling of Unicode fields
+        # Check Metadata handling of Unicode fields
         tmp_dir = self.mkdtemp()
         my_file = os.path.join(tmp_dir, 'f')
         cls = Distribution

File distutils2/tests/test_install.py

 
 from distutils2 import install
 from distutils2.index.xmlrpc import Client
-from distutils2.metadata import DistributionMetadata
+from distutils2.metadata import Metadata
 from distutils2.tests import run_unittest
 from distutils2.tests.support import TempdirManager
 from distutils2.tests.pypi_server import use_xmlrpc_server
     def __init__(self, name, version, deps):
         self.name = name
         self.version = version
-        self.metadata = DistributionMetadata()
+        self.metadata = Metadata()
         self.metadata['Requires-Dist'] = deps
         self.metadata['Provides-Dist'] = ['%s (%s)' % (name, version)]
 

File distutils2/tests/test_metadata.py

 import platform
 from StringIO import StringIO
 
-from distutils2.metadata import (DistributionMetadata,
+from distutils2.metadata import (Metadata,
                                  PKG_INFO_PREFERRED_VERSION)
 from distutils2.tests import run_unittest, unittest
 from distutils2.tests.support import LoggingCatcher, WarningsCatcher
                                MetadataUnrecognizedVersionError)
 
 
-class DistributionMetadataTestCase(LoggingCatcher, WarningsCatcher,
+class MetadataTestCase(LoggingCatcher, WarningsCatcher,
                                    unittest.TestCase):
 
     def test_instantiation(self):
             fp.close()
         fp = StringIO(contents)
 
-        m = DistributionMetadata()
+        m = Metadata()
         self.assertRaises(MetadataUnrecognizedVersionError, m.items)
 
-        m = DistributionMetadata(PKG_INFO)
+        m = Metadata(PKG_INFO)
         self.assertEqual(len(m.items()), 22)
 
-        m = DistributionMetadata(fileobj=fp)
+        m = Metadata(fileobj=fp)
         self.assertEqual(len(m.items()), 22)
 
-        m = DistributionMetadata(mapping=dict(name='Test', version='1.0'))
+        m = Metadata(mapping=dict(name='Test', version='1.0'))
         self.assertEqual(len(m.items()), 11)
 
         d = dict(m.items())
-        self.assertRaises(TypeError, DistributionMetadata,
+        self.assertRaises(TypeError, Metadata,
                           PKG_INFO, fileobj=fp)
-        self.assertRaises(TypeError, DistributionMetadata,
+        self.assertRaises(TypeError, Metadata,
                           PKG_INFO, mapping=d)
-        self.assertRaises(TypeError, DistributionMetadata,
+        self.assertRaises(TypeError, Metadata,
                           fileobj=fp, mapping=d)
-        self.assertRaises(TypeError, DistributionMetadata,
+        self.assertRaises(TypeError, Metadata,
                           PKG_INFO, mapping=m, fileobj=fp)
 
     def test_metadata_read_write(self):
         PKG_INFO = os.path.join(os.path.dirname(__file__), 'PKG-INFO')
-        metadata = DistributionMetadata(PKG_INFO)
+        metadata = Metadata(PKG_INFO)
         out = StringIO()
         metadata.write_file(out)
         out.seek(0)
-        res = DistributionMetadata()
+        res = Metadata()
         res.read_file(out)
         for k in metadata.keys():
             self.assertTrue(metadata[k] == res[k])
         PKG_INFO = os.path.join(os.path.dirname(__file__), 'PKG-INFO')
         content = open(PKG_INFO).read()
         content = content % sys.platform
-        metadata = DistributionMetadata(platform_dependent=True)
+        metadata = Metadata(platform_dependent=True)
         metadata.read_file(StringIO(content))
         self.assertEqual(metadata['Requires-Dist'], ['bar'])
         metadata['Name'] = "baz; sys.platform == 'blah'"
 
         # test with context
         context = {'sys.platform': 'okook'}
-        metadata = DistributionMetadata(platform_dependent=True,
+        metadata = Metadata(platform_dependent=True,
                                         execution_context=context)
         metadata.read_file(StringIO(content))
         self.assertEqual(metadata['Requires-Dist'], ['foo'])
         PKG_INFO = os.path.join(os.path.dirname(__file__), 'PKG-INFO')
         content = open(PKG_INFO).read()
         content = content % sys.platform
-        metadata = DistributionMetadata()
+        metadata = Metadata()
         metadata.read_file(StringIO(content))
 
         # see if we can read the description now
         PKG_INFO = os.path.join(os.path.dirname(__file__), 'PKG-INFO')
         content = open(PKG_INFO).read()
         content = content % sys.platform
-        metadata = DistributionMetadata(fileobj=StringIO(content))
+        metadata = Metadata(fileobj=StringIO(content))
         self.assertIn('Version', metadata.keys())
         self.assertIn('0.5', metadata.values())
         self.assertIn(('Version', '0.5'), metadata.items())
         self.assertEqual(metadata['Version'], '0.7')
 
     def test_versions(self):
-        metadata = DistributionMetadata()
+        metadata = Metadata()
         metadata['Obsoletes'] = 'ok'
         self.assertEqual(metadata['Metadata-Version'], '1.1')
 
 
     # XXX Spurious Warnings were disabled
     def XXXtest_warnings(self):
-        metadata = DistributionMetadata()
+        metadata = Metadata()
 
         # these should raise a warning
         values = (('Requires-Dist', 'Funky (Groovie)'),
         self.assertEqual(len(self.logs), 2)
 
     def test_multiple_predicates(self):
-        metadata = DistributionMetadata()
+        metadata = Metadata()
 
         # see for "3" instead of "3.0"  ???
         # its seems like the MINOR VERSION can be omitted
         self.assertEqual(len(self.warnings), 0)
 
     def test_project_url(self):
-        metadata = DistributionMetadata()
+        metadata = Metadata()
         metadata['Project-URL'] = [('one', 'http://ok')]
         self.assertEqual(metadata['Project-URL'],
                           [('one', 'http://ok')])
         self.assertEqual(metadata.version, '1.2')
 
     def test_check_version(self):
-        metadata = DistributionMetadata()
+        metadata = Metadata()
         metadata['Name'] = 'vimpdb'
         metadata['Home-page'] = 'http://pypi.python.org'
         metadata['Author'] = 'Monty Python'
         self.assertEqual(missing, ['Version'])
 
     def test_check_version_strict(self):
-        metadata = DistributionMetadata()
+        metadata = Metadata()
         metadata['Name'] = 'vimpdb'
         metadata['Home-page'] = 'http://pypi.python.org'
         metadata['Author'] = 'Monty Python'
         self.assertRaises(MetadataMissingError, metadata.check, strict=True)
 
     def test_check_name(self):
-        metadata = DistributionMetadata()
+        metadata = Metadata()
         metadata['Version'] = '1.0'
         metadata['Home-page'] = 'http://pypi.python.org'
         metadata['Author'] = 'Monty Python'
         self.assertEqual(missing, ['Name'])
 
     def test_check_name_strict(self):
-        metadata = DistributionMetadata()
+        metadata = Metadata()
         metadata['Version'] = '1.0'
         metadata['Home-page'] = 'http://pypi.python.org'
         metadata['Author'] = 'Monty Python'
         self.assertRaises(MetadataMissingError, metadata.check, strict=True)
 
     def test_check_author(self):
-        metadata = DistributionMetadata()
+        metadata = Metadata()
         metadata['Version'] = '1.0'
         metadata['Name'] = 'vimpdb'
         metadata['Home-page'] = 'http://pypi.python.org'
         self.assertEqual(missing, ['Author'])
 
     def test_check_homepage(self):
-        metadata = DistributionMetadata()
+        metadata = Metadata()
         metadata['Version'] = '1.0'
         metadata['Name'] = 'vimpdb'
         metadata['Author'] = 'Monty Python'
         self.assertEqual(missing, ['Home-page'])
 
     def test_check_predicates(self):
-        metadata = DistributionMetadata()
+        metadata = Metadata()
         metadata['Version'] = 'rr'
         metadata['Name'] = 'vimpdb'
         metadata['Home-page'] = 'http://pypi.python.org'
         self.assertEqual(len(warnings), 4)
 
     def test_best_choice(self):
-        metadata = DistributionMetadata()
+        metadata = Metadata()
         metadata['Version'] = '1.0'
         self.assertEqual(metadata.version, PKG_INFO_PREFERRED_VERSION)
         metadata['Classifier'] = ['ok']
     def test_project_urls(self):
         # project-url is a bit specific, make sure we write it
         # properly in PKG-INFO
-        metadata = DistributionMetadata()
+        metadata = Metadata()
         metadata['Version'] = '1.0'
         metadata['Project-Url'] = [('one', 'http://ok')]
         self.assertEqual(metadata['Project-Url'], [('one', 'http://ok')])
         self.assertIn('Project-URL: one,http://ok', res)
 
         file_.seek(0)
-        metadata = DistributionMetadata()
+        metadata = Metadata()
         metadata.read_file(file_)
         self.assertEqual(metadata['Project-Url'], [('one', 'http://ok')])
 
 
 def test_suite():
-    return unittest.makeSuite(DistributionMetadataTestCase)
+    return unittest.makeSuite(MetadataTestCase)
 
 if __name__ == '__main__':
     run_unittest(test_suite())

File distutils2/tests/test_mkcfg.py

 # -*- coding: utf-8 -*-
 """Tests for distutils.mkcfg."""
 import os
-import os.path as osp
 import sys
 import StringIO
-if sys.version_info[:2] < (2, 6):
-    from sets import Set as set
 from textwrap import dedent
 
 from distutils2.tests import run_unittest, support, unittest
         sys.stdin.write('y\n')
         sys.stdin.seek(0)
         main()
-        fid = open(osp.join(self.wdir, 'setup.cfg'))
-        lines = set([line.rstrip() for line in fid])
-        fid.close()
+        fp = open(os.path.join(self.wdir, 'setup.cfg'))
+        try:
+            lines = set([line.rstrip() for line in fp])
+        finally:
+            fp.close()
         self.assertEqual(lines, set(['',
             '[metadata]',
             'version = 0.2',
         sys.stdin.write('y\n')
         sys.stdin.seek(0)
         main()
-        fid = open(osp.join(self.wdir, 'setup.cfg'))
-        lines = set([line.strip() for line in fid])
-        fid.close()
+        fp = open(os.path.join(self.wdir, 'setup.cfg'))
+        try:
+            lines = set([line.strip() for line in fp])
+        finally:
+            fp.close()
         self.assertEqual(lines, set(['',
             '[metadata]',
             'version = 0.2',

File docs/design/pep-0376.txt

 
 - ``name``: The name of the distribution.
 
-- ``metadata``: A ``DistributionMetadata`` instance loaded with the
+- ``metadata``: A ``Metadata`` instance loaded with the
   distribution's PKG-INFO file.
 
 - ``requested``: A boolean that indicates whether the REQUESTED

File docs/source/distutils/apiref.rst

 .. function:: make_zipfile(base_name, base_dir[, verbose=0, dry_run=0])
 
    Create a zip file from all files in and under *base_dir*.  The output zip file
-   will be named *base_dir* + :file:`.zip`.  Uses either the :mod:`zipfile` Python
+   will be named *base_name* + :file:`.zip`.  Uses either the :mod:`zipfile` Python
    module (if available) or the InfoZIP :file:`zip` utility (if installed and
    found on the default search path).  If neither tool is available, raises
    :exc:`DistutilsExecError`.  Returns the name of the output zip file.
 
 .. module:: distutils2.metadata
 
-.. autoclass:: distutils2.metadata.DistributionMetadata
+.. FIXME CPython/stdlib docs don't use autoclass, write doc manually here
+
+.. autoclass:: distutils2.metadata.Metadata
    :members:
 
 :mod:`distutils2.util` --- Miscellaneous other utility functions

File docs/source/distutils/examples.rst

 ``2.7`` or ``3.2``.
 
 You can read back this static file, by using the
-:class:`distutils2.dist.DistributionMetadata` class and its
+:class:`distutils2.dist.Metadata` class and its
 :func:`read_pkg_file` method::
 
-    >>> from distutils2.metadata import DistributionMetadata
-    >>> metadata = DistributionMetadata()
+    >>> from distutils2.metadata import Metadata
+    >>> metadata = Metadata()
     >>> metadata.read_pkg_file(open('distribute-0.6.8-py2.7.egg-info'))
     >>> metadata.name
     'distribute'
 loads its values::
 
     >>> pkg_info_path = 'distribute-0.6.8-py2.7.egg-info'
-    >>> DistributionMetadata(pkg_info_path).name
+    >>> Metadata(pkg_info_path).name
     'distribute'
 
 

File docs/source/index.rst

 .. __: http://bitbucket.org/tarek/distutils2/wiki/GSoC_2010_teams
 
 If you’re looking for information on how to contribute, head to
-:doc:`devresources`.
+:doc:`devresources`, and be sure to have a look at :doc:`contributing`.
 
 
 Documentation
    distutils/index
    library/distutils2
    library/pkgutil
+   contributing
 
 
 Indices and tables

File docs/source/library/distutils2.metadata.rst

 
 .. module:: distutils2.metadata
 
-Distutils2 provides a :class:`~distutils2.metadata.DistributionMetadata` class that can read and
+Distutils2 provides a :class:`~distutils2.metadata.Metadata` class that can read and
 write metadata files. This class is compatible with all metadata versions:
 
 * 1.0: :PEP:`241`
 Reading metadata
 ================
 
-The :class:`~distutils2.metadata.DistributionMetadata` class can be instantiated with the path of
+The :class:`~distutils2.metadata.Metadata` class can be instantiated with the path of
 the metadata file, and provides a dict-like interface to the values::
 
-    >>> from distutils2.metadata import DistributionMetadata
-    >>> metadata = DistributionMetadata('PKG-INFO')
+    >>> from distutils2.metadata import Metadata
+    >>> metadata = Metadata('PKG-INFO')
     >>> metadata.keys()[:5]
     ('Metadata-Version', 'Name', 'Version', 'Platform', 'Supported-Platform')
     >>> metadata['Name']
 
 The fields that supports environment markers can be automatically ignored if
 the object is instantiated using the ``platform_dependent`` option.
-:class:`~distutils2.metadata.DistributionMetadata` will interpret in the case the markers and will
+:class:`~distutils2.metadata.Metadata` will interpret in the case the markers and will
 automatically remove the fields that are not compliant with the running
 environment. Here's an example under Mac OS X. The win32 dependency
 we saw earlier is ignored::
 
-    >>> from distutils2.metadata import DistributionMetadata
-    >>> metadata = DistributionMetadata('PKG-INFO', platform_dependent=True)
+    >>> from distutils2.metadata import Metadata
+    >>> metadata = Metadata('PKG-INFO', platform_dependent=True)
     >>> metadata['Requires-Dist']
     ['bar']
 
 
 Here's an example, simulating a win32 environment::
 
-    >>> from distutils2.metadata import DistributionMetadata
+    >>> from distutils2.metadata import Metadata
     >>> context = {'sys.platform': 'win32'}
-    >>> metadata = DistributionMetadata('PKG-INFO', platform_dependent=True,
+    >>> metadata = Metadata('PKG-INFO', platform_dependent=True,
     ...                                 execution_context=context)
     ...
     >>> metadata['Requires-Dist'] = ["pywin32; sys.platform == 'win32'",
 Some fields in :PEP:`345` have to follow a version scheme in their versions
 predicate. When the scheme is violated, a warning is emitted::
 
-    >>> from distutils2.metadata import DistributionMetadata
-    >>> metadata = DistributionMetadata()
+    >>> from distutils2.metadata import Metadata
+    >>> metadata = Metadata()
     >>> metadata['Requires-Dist'] = ['Funky (Groovie)']
     "Funky (Groovie)" is not a valid predicate
     >>> metadata['Requires-Dist'] = ['Funky (1.2)']