diff --git a/.travis.yml b/.travis.yml index 485bc02..dccfca1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,29 +4,31 @@ services: env: global: - - CODECLIMATE_REPO_TOKEN=a47935830d841ad61a6e960be8a3b6a5e557146ac010dafa993e61bf82898472 + - CC_TEST_REPORTER_ID=a47935830d841ad61a6e960be8a3b6a5e557146ac010dafa993e61bf82898472 language: python python: -- 3.6 + - 3.6 addons: firefox: "49.0.2" -install: -- pip install -r requirements/requirements-test.txt - before_script: - wget https://github.com/mozilla/geckodriver/releases/download/v0.11.1/geckodriver-v0.11.1-linux64.tar.gz - mkdir geckodriver - tar -xzf geckodriver-v0.11.1-linux64.tar.gz -C geckodriver - export PATH=$PATH:$PWD/geckodriver - "export DISPLAY=:99.0" + - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter + - chmod +x ./cc-test-reporter + - ./cc-test-reporter before-build script: -- pytest --cov-config .coveragerc --cov=scrapy_selenium tests/ -- codeclimate-test-reporter + - python setup.py test + +after_script: + - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT notifications: email: false diff --git a/MANIFEST.in b/MANIFEST.in index 2b3aaa6..e69de29 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1 +0,0 @@ -include requirements/requirements.txt diff --git a/requirements/requirements-test.txt b/requirements/requirements-test.txt deleted file mode 100644 index 2addc1f..0000000 --- a/requirements/requirements-test.txt +++ /dev/null @@ -1,7 +0,0 @@ --r requirements.txt - -pytest==3.4.0 -coverage<4.4 -pytest-cov==2.4.0 -codeclimate-test-reporter==0.2.3 -attrs>=17.4.0 diff --git a/requirements/requirements.txt b/requirements/requirements.txt deleted file mode 100644 index e6e2710..0000000 --- a/requirements/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -scrapy>=1.0.0 -selenium>=3.9.0 diff --git a/setup.cfg b/setup.cfg index 2ca31e9..336c7f0 100644 --- a/setup.cfg +++ b/setup.cfg @@ -11,3 +11,9 @@ include_package_data = true [pep8] max-line-length = 100 + +[aliases] +test=pytest + +[tool:pytest] +addopts = --cov-config .coveragerc --cov=scrapy_selenium tests/ diff --git a/setup.py b/setup.py index 16fd185..8e3b98d 100644 --- a/setup.py +++ b/setup.py @@ -1,34 +1,20 @@ """This module contains the packaging routine for the pybook package""" from setuptools import setup, find_packages -try: - from pip.download import PipSession - from pip.req import parse_requirements -except ImportError: - # It is quick hack to support pip 10 that has changed its internal - # structure of the modules. - from pip._internal.download import PipSession - from pip._internal.req.req_file import parse_requirements - - -def get_requirements(source): - """Get the requirements from the given ``source`` - - Parameters - ---------- - source: str - The filename containing the requirements - - """ - - install_reqs = parse_requirements(filename=source, session=PipSession()) - - return [str(ir.req) for ir in install_reqs] - setup( packages=find_packages(), - install_requires=get_requirements('requirements/requirements.txt') + setup_requires=[ + "pytest-runner", + ], + install_requires=[ + "scrapy>=1.0.0", + "selenium>=3.9.0", + ], + tests_require=[ + "pytest", + "coverage", + "pytest-cov", + "codeclimate-test-reporter", + ] ) - -