Convert to a package, use pbr, update metadata.

In particular this changes the author from Michael to the
testing-cabal group.
diff --git a/mock/__init__.py b/mock/__init__.py
new file mode 100644
index 0000000..82a3110
--- /dev/null
+++ b/mock/__init__.py
@@ -0,0 +1,7 @@
+from __future__ import absolute_import
+import mock.mock as _mock
+from mock.mock import *
+__all__ = _mock.__all__
+#import mock.mock as _mock
+#for name in dir(_mock):
+#  globals()[name] = getattr(_mock, name)
diff --git a/mock.py b/mock/mock.py
similarity index 99%
rename from mock.py
rename to mock/mock.py
index 223231f..b9c2222 100644
--- a/mock.py
+++ b/mock/mock.py
@@ -32,6 +32,8 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+from __future__ import absolute_import
+
 __all__ = (
     'Mock',
     'MagicMock',
@@ -42,6 +44,7 @@
     'call',
     'create_autospec',
     'FILTER_DIR',
+    'CallableMixin',
     'NonCallableMock',
     'NonCallableMagicMock',
     'mock_open',
@@ -65,6 +68,7 @@
 import six
 from six import wraps
 
+import mock
 
 inPy3k = sys.version_info[0] == 3
 
@@ -147,6 +151,7 @@
     self = '__self__'
     builtin = 'builtins'
 
+# NOTE: This FILTER_DIR is not used. The binding in mock.FILTER_DIR is.
 FILTER_DIR = True
 
 # Workaround for Python issue #12370
@@ -782,7 +787,7 @@
 
     def __dir__(self):
         """Filter the output of `dir(mock)` to only useful members."""
-        if not FILTER_DIR and getattr(object, '__dir__', None):
+        if not mock.FILTER_DIR and getattr(object, '__dir__', None):
             # object.__dir__ is not in 2.7
             return object.__dir__(self)
 
@@ -790,7 +795,7 @@
         from_type = dir(type(self))
         from_dict = list(self.__dict__)
 
-        if FILTER_DIR:
+        if mock.FILTER_DIR:
             # object.__dir__ is not in 2.7
             from_type = [e for e in from_type if not e.startswith('_')]
             from_dict = [e for e in from_dict if not e.startswith('_') or
diff --git a/tests/__init__.py b/mock/tests/__init__.py
similarity index 100%
rename from tests/__init__.py
rename to mock/tests/__init__.py
diff --git a/tests/__main__.py b/mock/tests/__main__.py
similarity index 100%
rename from tests/__main__.py
rename to mock/tests/__main__.py
diff --git a/tests/support.py b/mock/tests/support.py
similarity index 100%
rename from tests/support.py
rename to mock/tests/support.py
diff --git a/tests/testcallable.py b/mock/tests/testcallable.py
similarity index 98%
rename from tests/testcallable.py
rename to mock/tests/testcallable.py
index 740870d..10acdc3 100644
--- a/tests/testcallable.py
+++ b/mock/tests/testcallable.py
@@ -3,7 +3,7 @@
 # http://www.voidspace.org.uk/python/mock/
 
 import unittest2 as unittest
-from tests.support import is_instance, X, SomeClass
+from mock.tests.support import is_instance, X, SomeClass
 
 from mock import (
     Mock, MagicMock, NonCallableMagicMock,
diff --git a/tests/testhelpers.py b/mock/tests/testhelpers.py
similarity index 99%
rename from tests/testhelpers.py
rename to mock/tests/testhelpers.py
index 6902c60..99316e5 100644
--- a/tests/testhelpers.py
+++ b/mock/tests/testhelpers.py
@@ -3,12 +3,13 @@
 # http://www.voidspace.org.uk/python/mock/
 
 import unittest2 as unittest
-from tests.support import inPy3k
+from mock.tests.support import inPy3k
 
 from mock import (
-    call, _Call, create_autospec, MagicMock,
-    Mock, ANY, _CallList, patch, PropertyMock
+    call, create_autospec, MagicMock,
+    Mock, ANY, patch, PropertyMock
 )
+from mock.mock import _Call, _CallList
 
 from datetime import datetime
 
diff --git a/tests/testmagicmethods.py b/mock/tests/testmagicmethods.py
similarity index 99%
rename from tests/testmagicmethods.py
rename to mock/tests/testmagicmethods.py
index 0fa2602..5e39770 100644
--- a/tests/testmagicmethods.py
+++ b/mock/tests/testmagicmethods.py
@@ -6,7 +6,7 @@
 
 import unittest2 as unittest
 
-from tests.support import inPy3k
+from mock.tests.support import inPy3k
 
 try:
     unicode
@@ -18,7 +18,8 @@
 import inspect
 import sys
 import textwrap
-from mock import Mock, MagicMock, _magics
+from mock import Mock, MagicMock
+from mock.mock import _magics
 
 
 
diff --git a/tests/testmock.py b/mock/tests/testmock.py
similarity index 99%
rename from tests/testmock.py
rename to mock/tests/testmock.py
index 38d1699..17e7999 100644
--- a/tests/testmock.py
+++ b/mock/tests/testmock.py
@@ -3,7 +3,7 @@
 # http://www.voidspace.org.uk/python/mock/
 
 import unittest2 as unittest
-from tests.support import (
+from mock.tests.support import (
     callable, inPy3k, is_instance, next
 )
 
@@ -15,9 +15,10 @@
 from mock import (
     call, DEFAULT, patch, sentinel,
     MagicMock, Mock, NonCallableMock,
-    NonCallableMagicMock, _CallList,
+    NonCallableMagicMock,
     create_autospec
 )
+from mock.mock import _CallList
 
 
 try:
diff --git a/tests/testpatch.py b/mock/tests/testpatch.py
similarity index 99%
rename from tests/testpatch.py
rename to mock/tests/testpatch.py
index a2d0138..ce84df2 100644
--- a/tests/testpatch.py
+++ b/mock/tests/testpatch.py
@@ -7,14 +7,15 @@
 
 import unittest2 as unittest
 
-from tests import support
-from tests.support import inPy3k, SomeClass, is_instance, callable
+from mock.tests import support
+from mock.tests.support import inPy3k, SomeClass, is_instance, callable
 
 from mock import (
     NonCallableMock, CallableMixin, patch, sentinel,
-    MagicMock, Mock, NonCallableMagicMock, patch, _patch,
-    DEFAULT, call, _get_target
+    MagicMock, Mock, NonCallableMagicMock, patch,
+    DEFAULT, call
 )
+from mock.mock import _patch, _get_target
 
 builtin_string = '__builtin__'
 if inPy3k:
@@ -1622,7 +1623,7 @@
 
 
     def test_patch_nested_autospec_repr(self):
-        p = patch('tests.support', autospec=True)
+        p = patch('mock.tests.support', autospec=True)
         m = p.start()
         try:
             self.assertIn(" name='support.SomeClass.wibble()'",
diff --git a/tests/testsentinel.py b/mock/tests/testsentinel.py
similarity index 100%
rename from tests/testsentinel.py
rename to mock/tests/testsentinel.py
diff --git a/tests/testwith.py b/mock/tests/testwith.py
similarity index 99%
rename from tests/testwith.py
rename to mock/tests/testwith.py
index 7939c92..fde2a63 100644
--- a/tests/testwith.py
+++ b/mock/tests/testwith.py
@@ -6,7 +6,7 @@
 
 import unittest2 as unittest
 
-from tests.support import is_instance
+from mock.tests.support import is_instance
 from mock import MagicMock, Mock, patch, sentinel, mock_open, call
 
 
diff --git a/requirements.txt b/requirements.txt
new file mode 100644
index 0000000..fe98ba1
--- /dev/null
+++ b/requirements.txt
@@ -0,0 +1,2 @@
+funcsigs;python_version<"3.3"
+six
diff --git a/setup.cfg b/setup.cfg
index 566eb37..40b96e9 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,5 +1,39 @@
-[build_sphinx]
-source-dir=docs
-build-dir=html
-[sdist]
-force-manifest = 1
+[metadata]
+name = mock
+summary = Rolling backport of unittest.mock for all Pythons
+home-page = https://github.com/testing-cabal/mock
+description-file = README.txt
+author = Testing Cabal
+author-email = testing-in-python@lists.idyll.org
+classifier = 
+    Development Status :: 5 - Production/Stable
+    Environment :: Console
+    Intended Audience :: Developers
+    License :: OSI Approved :: BSD License
+    Operating System :: OS Independent
+    Programming Language :: Python
+    Programming Language :: Python :: 2
+    Programming Language :: Python :: 2.7
+    Programming Language :: Python :: 3
+    Programming Language :: Python :: 3.2
+    Programming Language :: Python :: 3.3
+    Programming Language :: Python :: 3.4
+    Programming Language :: Python :: 3.5
+    Programming Language :: Python :: Implementation :: CPython
+    Programming Language :: Python :: Implementation :: Jython
+    Programming Language :: Python :: Implementation :: PyPy
+    Topic :: Software Development :: Libraries
+    Topic :: Software Development :: Libraries :: Python Modules
+    Topic :: Software Development :: Testing
+keyword =
+    testing, test, mock, mocking, unittest, patching, stubs, fakes, doubles
+
+[extras]
+test =
+  unittest2>=1.1.0
+
+[files]
+packages = mock
+
+[bdist_wheel]
+universal = 1
diff --git a/setup.py b/setup.py
index 3083f81..c72c231 100755
--- a/setup.py
+++ b/setup.py
@@ -1,72 +1,7 @@
-#! /usr/bin/env python
-
-# Copyright (C) 2007-2012 Michael Foord & the mock team
-# E-mail: fuzzyman AT voidspace DOT org DOT uk
-# http://www.voidspace.org.uk/python/mock/
-
-from __version__ import __version__
-
-import os
-
-from setuptools import setup
-
-NAME = 'mock'
-MODULES = ['mock']
-DESCRIPTION = 'A Python Mocking and Patching Library for Testing'
-
-URL = "http://www.voidspace.org.uk/python/mock/"
-
-readme = os.path.join(os.path.dirname(__file__), 'README.txt')
-LONG_DESCRIPTION = open(readme).read()
-
-CLASSIFIERS = [
-    'Development Status :: 5 - Production/Stable',
-    'Environment :: Console',
-    'Intended Audience :: Developers',
-    'License :: OSI Approved :: BSD License',
-    'Programming Language :: Python',
-    'Programming Language :: Python :: 2',
-    'Programming Language :: Python :: 3',
-    'Programming Language :: Python :: 2.7',
-    'Programming Language :: Python :: 3.2',
-    'Programming Language :: Python :: 3.3',
-    'Programming Language :: Python :: 3.4',
-    'Programming Language :: Python :: 3.5',
-    'Programming Language :: Python :: Implementation :: CPython',
-    'Programming Language :: Python :: Implementation :: PyPy',
-    'Programming Language :: Python :: Implementation :: Jython',
-    'Operating System :: OS Independent',
-    'Topic :: Software Development :: Libraries',
-    'Topic :: Software Development :: Libraries :: Python Modules',
-    'Topic :: Software Development :: Testing',
-]
-
-AUTHOR = 'Michael Foord'
-AUTHOR_EMAIL = 'michael@voidspace.org.uk'
-KEYWORDS = ("testing test mock mocking unittest patching "
-            "stubs fakes doubles").split(' ')
-
-params = dict(
-    name=NAME,
-    version=__version__,
-    py_modules=MODULES,
-
-    # metadata for upload to PyPI
-    author=AUTHOR,
-    author_email=AUTHOR_EMAIL,
-    description=DESCRIPTION,
-    long_description=LONG_DESCRIPTION,
-    keywords=KEYWORDS,
-    url=URL,
-    classifiers=CLASSIFIERS,
-    extras_require={
-        ':python_version<"3.3"': ['funcsigs'],
-        'test': ['unittest2'],
-        },
-    install_requires=['six'],
-    tests_require=['unittest2'],
-    test_suite='unittest2.collector',
-)
+#!/usr/bin/env python
+import setuptools
 
 
-setup(**params)
+setuptools.setup(
+    setup_requires=['pbr'],
+    pbr=True)