Skip to content

Commit

Permalink
Add requirements.txt and requires keyword parameter for setup.
Browse files Browse the repository at this point in the history
  • Loading branch information
lig committed May 21, 2012
1 parent f7c670c commit 048ae1a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
3 changes: 3 additions & 0 deletions requirements.txt
@@ -0,0 +1,3 @@
Django
mongoengine>=0.6
pymongo>=2.1
26 changes: 15 additions & 11 deletions setup.py
@@ -1,29 +1,31 @@
from setuptools import setup, find_packages
from setuptools.command.test import test



class TestRunner(test):

def run(self):

if self.distribution.install_requires:
self.distribution.fetch_build_eggs(self.distribution.install_requires)
self.distribution.fetch_build_eggs(
self.distribution.install_requires)
if self.distribution.tests_require:
self.distribution.fetch_build_eggs(self.distribution.tests_require)

import sys
sys.path.insert(0, 'testprj')

from testprj import settings as test_settings
from django.conf import settings
settings.configure(test_settings)

from testprj.tests import mongoforms_test_runner as test_runner

test_suite = test_runner.build_suite(['testapp'])
test_runner.setup_test_environment()
result = test_runner.run_suite(test_suite)
test_runner.teardown_test_environment()

return result


Expand All @@ -36,7 +38,8 @@ def run(self):
maintainer='Serge Matveenko',
maintainer_email='s@matveenko.ru',
url='http://github.com/stephrdev/django-mongoforms/',
packages=find_packages(exclude=['examples', 'examples.*', 'testprj', 'testprj.*']),
packages=find_packages(
exclude=['examples', 'examples.*', 'testprj', 'testprj.*']),
classifiers=[
'Development Status :: 3 - Alpha',
'Environment :: Web Environment',
Expand All @@ -47,5 +50,6 @@ def run(self):
'Framework :: Django',
],
zip_safe=False,
cmdclass={"test": TestRunner}
cmdclass={"test": TestRunner},
requires=['Django', 'mongoengine(>=0.6)', 'pymongo(>=2.1)']
)

0 comments on commit 048ae1a

Please sign in to comment.