summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorBenjamin Drung <benjamin.drung@profitbricks.com>2014-03-26 11:57:56 +0100
committerBenjamin Drung <benjamin.drung@profitbricks.com>2014-03-26 11:57:56 +0100
commitd86a78f7fe72eed37835417ec50f9249a3bc111d (patch)
tree82e017c7b85a173ef0dd780afdc83a8c89120d13 /setup.py
parente2c3c9f50f3bdb537ef863d7cff80d4fd5e27911 (diff)
downloadappdirs-d86a78f7fe72eed37835417ec50f9249a3bc111d.tar.gz
Replace distutils.core by setuptools and add unittest2 as test dependency for Python < 2.7.
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py43
1 files changed, 6 insertions, 37 deletions
diff --git a/setup.py b/setup.py
index a787d65..3cf1b4e 100644
--- a/setup.py
+++ b/setup.py
@@ -2,43 +2,12 @@
import sys
import os
import os.path
-from distutils.core import setup, Command
+from setuptools import setup
import appdirs
-requires_list = []
-try:
- import unittest2 as unittest
-except ImportError:
- import unittest
-else:
- if sys.version_info <= (2, 6):
- requires_list.append("unittest2")
-
-
-class RunTests(Command):
- """New setup.py command to run all tests for the package.
- """
- description = "run all tests for the package"
-
- user_options = []
-
- def initialize_options(self):
- pass
-
- def finalize_options(self):
- pass
-
- def run(self):
- test_modules = ["test.%s" % filename.replace('.py', '')
- for filename in os.listdir('test')
- if filename.endswith('.py') and filename.startswith('test_')]
- for mod in test_modules:
- __import__(mod)
-
- suite = unittest.TestSuite()
- for mod in [sys.modules[modname] for modname in test_modules]:
- suite.addTest(unittest.TestLoader().loadTestsFromModule(mod))
- unittest.TextTestRunner(verbosity=2).run(suite)
+tests_require = []
+if sys.version_info < (2, 7):
+ tests_require.append("unittest2")
def read(fname):
@@ -53,7 +22,6 @@ setup(name='appdirs',
description='A small Python module for determining appropriate " + \
"platform-specific dirs, e.g. a "user data dir".',
long_description=read('README.rst') + '\n' + read('CHANGES.rst'),
- cmdclass={'test': RunTests},
classifiers=[c.strip() for c in """
Development Status :: 4 - Beta
Intended Audience :: Developers
@@ -69,7 +37,8 @@ setup(name='appdirs',
Programming Language :: Python :: 3.2
Topic :: Software Development :: Libraries :: Python Modules
""".split('\n') if c.strip()],
- requires=requires_list,
+ test_suite='test.test_api',
+ tests_require=tests_require,
keywords='application directory log cache user',
author='Trent Mick',
author_email='trentm@gmail.com',