Permalink
Browse files

Get setup.py tests working.

  • Loading branch information...
Guido Bartolucci
Guido Bartolucci committed Aug 20, 2011
1 parent 802cceb commit 8bcca46dd9b9c9ee3fab8693b2d6f5e86f45dbd6
Showing with 34 additions and 10 deletions.
  1. +0 −1 README.md
  2. +20 −9 setup.py
  3. +14 −0 tests.py
View
@@ -19,7 +19,6 @@ Features
* Optional per-request object registry
* Optional support for soft deletes
-
Motivation and Assumptions
==========================
View
@@ -1,9 +1,20 @@
-from distutils.core import setup
-setup(name='django-listy-cache',
- version='0.9.0',
- description='A deterministic caching plugin for Django',
- author='Wavii, Inc.',
- author_email='info@wavii.com',
- url='http://github.com/wavii/listy',
- packages=['listy'],
- )
+try:
+ from setuptools import setup, find_packages
+except ImportError:
+ from ez_setup import use_setuptools
+ use_setuptools()
+ from setuptools import setup, find_packages
+
+setup(
+ name='django-list-cache',
+ version='0.9.0',
+ description='A deterministic caching mechanism for Django',
+ long_description='Listy is a deterministic caching mechanism for django projects. It will attempt to keep the cache in-sync with the database by updating during changes instead of relying on timeouts. As implied by the name, Listy supports looking up lists of objects.',
+ author='Wavii, Inc.',
+ author_email='info@wavii.com',
+ url='https://github.com/wavii/django-list-cache/',
+ packages=['listy'],
+ install_requires=['Django>=1.2, <1.3', 'python-dateutil>=1.5', 'python-memcached>=1.45'],
+ test_suite='tests.run',
+ license='MIT License',
+)
View
@@ -0,0 +1,14 @@
+#This file mainly exists to allow python setup.py test to work.
+
+import os, sys
+os.environ['DJANGO_SETTINGS_MODULE'] = 'test_django_app.settings'
+test_dir = os.path.dirname(__file__)
+sys.path.insert(0, test_dir)
+
+from django.test.utils import get_runner
+from django.conf import settings
+
+def run():
+ TestRunner = get_runner(settings)
+ failures = TestRunner(verbosity=1, interactive=True).run_tests([])
+ sys.exit(failures)

0 comments on commit 8bcca46

Please sign in to comment.