Skip to content

Commit

Permalink
Make pytest default test runner in setup.py. Fix install_requires.
Browse files Browse the repository at this point in the history
Now it's possible to run the tests by:

  python setup.py test
  • Loading branch information
dimazest committed Oct 17, 2013
1 parent 4bf0b3c commit 867123a
Showing 1 changed file with 42 additions and 14 deletions.
56 changes: 42 additions & 14 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,45 @@
#!/usr/bin/env python
import sys

from distutils.core import setup
from setuptools import setup
from setuptools.command.test import test as TestCommand

setup(name='dissect',
version='0.1.0',
description='COMPOSES DISSECT TOOLKIT',
author='Georgiana Dinu, The Nghia Pham, Marco Baroni',
author_email='[email protected],[email protected]',
url='http://http://clic.cimec.unitn.it/composes/toolkit/',
requires=['numpy','scipy','sparsesvd'],
package_dir={'':'src'},
packages=['composes','composes.composition','composes.matrix','composes.semantic_space',
'composes.exception','composes.similarity','composes.transformation','composes.utils',
'composes.transformation.dim_reduction','composes.transformation.feature_selection',
'composes.transformation.scaling'],
)

class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = 'src/unitest'
self.test_suite = True

def run_tests(self):
#import here, cause outside the eggs aren't loaded
import pytest
errno = pytest.main(self.test_args)
sys.exit(errno)


setup(
name='dissect',
version='0.1.0',
description='COMPOSES DISSECT TOOLKIT',
author='Georgiana Dinu, The Nghia Pham, Marco Baroni',
author_email='[email protected],[email protected]',
url='http://http://clic.cimec.unitn.it/composes/toolkit/',
install_requires=['numpy', 'scipy', 'sparsesvd'],
tests_require=['pytest'],
cmdclass={'test': PyTest},
package_dir={'': 'src'},
packages=[
'composes',
'composes.composition',
'composes.matrix',
'composes.semantic_space',
'composes.exception',
'composes.similarity',
'composes.transformation',
'composes.utils',
'composes.transformation.dim_reduction',
'composes.transformation.feature_selection',
'composes.transformation.scaling',
],
)

0 comments on commit 867123a

Please sign in to comment.