diff --git a/.travis.yml b/.travis.yml index 3e21ae5..eb4799b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,9 +22,9 @@ before_install: install: - | if [ "$TEST_TYPE" = build ]; then - pip install pytest==3.0.2 pytest-cov pytest-benchmark coveralls six pytest-django==2.9.1 mock django-filter + pip install -e .[test] + pip install psycopg2 # Required for Django postgres fields testing pip install django==$DJANGO_VERSION - pip install -e . python setup.py develop elif [ "$TEST_TYPE" = lint ]; then pip install flake8 diff --git a/README.md b/README.md index ed8b22d..e3927a8 100644 --- a/README.md +++ b/README.md @@ -99,13 +99,13 @@ To learn more check out the following [examples](examples/): After cloning this repo, ensure dependencies are installed by running: ```sh -python setup.py install +pip install -e ".[test]" ``` After developing, the full test suite can be evaluated by running: ```sh -python setup.py test # Use --pytest-args="-v -s" for verbose mode +py.test graphene_django --cov=graphene_django # Use -v -s for verbose mode ``` diff --git a/README.rst b/README.rst index 1f594a9..21b222b 100644 --- a/README.rst +++ b/README.rst @@ -109,21 +109,21 @@ After cloning this repo, ensure dependencies are installed by running: .. code:: sh - python setup.py install + pip install -e ".[test]" After developing, the full test suite can be evaluated by running: .. code:: sh - python setup.py test # Use --pytest-args="-v -s" for verbose mode + py.test graphene_django --cov=graphene_django # Use -v -s for verbose mode Documentation ~~~~~~~~~~~~~ -The documentation can be generated using the excellent +The documentation is generated using the excellent `Sphinx `__ and a custom theme. -To install the documentation dependencies, run the following: +The documentation dependencies are installed by running: .. code:: sh diff --git a/setup.py b/setup.py index 7a4eaa7..38a16c5 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,15 @@ from setuptools import find_packages, setup +tests_require = [ + 'pytest>=2.7.2', + 'pytest-cov', + 'coveralls', + 'mock', + 'pytz', + 'django-filter', + 'pytest-django==2.9.1', +] + setup( name='graphene-django', version='1.2.1', @@ -41,14 +51,10 @@ setup( setup_requires=[ 'pytest-runner', ], - tests_require=[ - 'django-filter>=1.0.0', - 'pytest', - 'pytest-django==2.9.1', - 'mock', - # Required for Django postgres fields testing - 'psycopg2', - ], + tests_require=tests_require, + extras_require={ + 'test': tests_require, + }, include_package_data=True, zip_safe=False, platforms='any',