#!/usr/bin/env python
# coding=utf-8

import os
import io
from setuptools import setup, find_packages

here = os.path.abspath(os.path.dirname(__file__))
README = io.open(os.path.join(here, 'README.rst'), encoding="utf8").read()
NEWS = io.open(os.path.join(here, 'CHANGELOG.rst'), encoding="utf8").read()


version = '0.5.3'

# this module can be zip-safe if the zipimporter implements iter_modules or if
# pkgutil.iter_importer_modules has registered a dispatch for the zipimporter.
try:
    import pkgutil
    import zipimport
    zip_safe = hasattr(zipimport.zipimporter, "iter_modules") or \
        zipimport.zipimporter in pkgutil.iter_importer_modules.registry.keys()
except (ImportError, AttributeError):
    zip_safe = False

setup(
    name='fake-factory',
    version=version,
    description="Faker is a Python package that generates fake data for you.",
    long_description=README + '\n\n' + NEWS,
    entry_points={
        'console_scripts': ['faker=faker.cli:execute_from_command_line'],
    },
    classifiers=[
        # See https://pypi.python.org/pypi?%3Aaction=list_classifiers
        'Development Status :: 3 - Alpha',
        'Environment :: Console',
        'Intended Audience :: Developers',
        'Programming Language :: Python',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.4',
        'Topic :: Software Development :: Libraries :: Python Modules',
        'Topic :: Software Development :: Testing',
        'Topic :: Utilities',
        'License :: OSI Approved :: MIT License'
    ],
    keywords='faker fixtures data test mock generator',
    author='joke2k',
    author_email='joke2k@gmail.com',
    url='http://github.com/joke2k/faker',
    license='MIT License',
    packages=find_packages(exclude=['*.tests']),
    platforms=["any"],
    test_suite='faker.tests',
    zip_safe=zip_safe,
    extras_require={
        ':python_version=="2.6"': ['importlib'],
        ':python_version=="3.0"': ['importlib'],
    }
)

setup.py
#!/usr/bin/env python
# coding=utf-8

import os
import io
from setuptools import setup, find_packages

here = os.path.abspath(os.path.dirname(__file__))
README = io.open(os.path.join(here, 'README.rst'), encoding="utf8").read()
NEWS = io.open(os.path.join(here, 'CHANGELOG.rst'), encoding="utf8").read()


version = '0.5.3'

# this module can be zip-safe if the zipimporter implements iter_modules or if
# pkgutil.iter_importer_modules has registered a dispatch for the zipimporter.
try:
    import pkgutil
    import zipimport
    zip_safe = hasattr(zipimport.zipimporter, "iter_modules") or \
        zipimport.zipimporter in pkgutil.iter_importer_modules.registry.keys()
except (ImportError, AttributeError):
    zip_safe = False

setup(
    name='fake-factory',
    version=version,
    description="Faker is a Python package that generates fake data for you.",
    long_description=README + '\n\n' + NEWS,
    entry_points={
        'console_scripts': ['faker=faker.cli:execute_from_command_line'],
    },
    classifiers=[
        # See https://pypi.python.org/pypi?%3Aaction=list_classifiers
        'Development Status :: 3 - Alpha',
        'Environment :: Console',
        'Intended Audience :: Developers',
        'Programming Language :: Python',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.4',
        'Topic :: Software Development :: Libraries :: Python Modules',
        'Topic :: Software Development :: Testing',
        'Topic :: Utilities',
        'License :: OSI Approved :: MIT License'
    ],
    keywords='faker fixtures data test mock generator',
    author='joke2k',
    author_email='joke2k@gmail.com',
    url='http://github.com/joke2k/faker',
    license='MIT License',
    packages=find_packages(),
    platforms=["any"],
    test_suite='faker.tests',
    zip_safe=zip_safe,
    extras_require={
        ':python_version=="2.6"': ['importlib'],
        ':python_version=="3.0"': ['importlib'],
    }
)

setup.py
diff --git a/setup.py b/setup.py
index d89f76fa52..e342ef9fb2 100644
--- a/setup.py
+++ b/setup.py
@@ -49,7 +49,7 @@
     author_email='joke2k@gmail.com',
     url='http://github.com/joke2k/faker',
     license='MIT License',
-    packages=find_packages(exclude=['*.tests']),
+    packages=find_packages(),
     platforms=["any"],
     test_suite='faker.tests',
     zip_safe=zip_safe,

Fail to run the tests
Another problem I have when building the RPM is when I try to run the tests. This is in a minimal build environment, so maybe some library is missing. I have tried to use PYTHONPATH like in issue #291 but with no success.

Could you help me?

```
+ /usr/bin/python2 setup.py test
running test
running egg_info
writing requirements to fake_factory.egg-info/requires.txt
writing fake_factory.egg-info/PKG-INFO
writing top-level names to fake_factory.egg-info/top_level.txt
writing dependency_links to fake_factory.egg-info/dependency_links.txt
writing entry points to fake_factory.egg-info/entry_points.txt
reading manifest file 'fake_factory.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*.md'
writing manifest file 'fake_factory.egg-info/SOURCES.txt'
running build_ext
Traceback (most recent call last):
  File "setup.py", line 58, in <module>
    ':python_version=="3.0"': ['importlib'],
  File "/usr/lib64/python2.7/distutils/core.py", line 151, in setup
    dist.run_commands()
  File "/usr/lib64/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/lib64/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/usr/lib/python2.7/site-packages/setuptools/command/test.py", line 142, in run
    self.with_project_on_sys_path(self.run_tests)
  File "/usr/lib/python2.7/site-packages/setuptools/command/test.py", line 122, in with_project_on_sys_path
    func()
  File "/usr/lib/python2.7/site-packages/setuptools/command/test.py", line 163, in run_tests
    testRunner=self._resolve_as_ep(self.test_runner),
  File "/usr/lib64/python2.7/unittest/main.py", line 94, in __init__
    self.parseArgs(argv)
  File "/usr/lib64/python2.7/unittest/main.py", line 149, in parseArgs
    self.createTests()
  File "/usr/lib64/python2.7/unittest/main.py", line 158, in createTests
    self.module)
  File "/usr/lib64/python2.7/unittest/loader.py", line 130, in loadTestsFromNames
    suites = [self.loadTestsFromName(name, module) for name in names]
  File "/usr/lib64/python2.7/unittest/loader.py", line 100, in loadTestsFromName
    parent, obj = obj, getattr(obj, part)
AttributeError: 'module' object has no attribute 'tests'
```

