diff --git a/.travis.yml b/.travis.yml index ee9d7aa..79b05e2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,49 @@ sudo: false +cache: + pip: true language: python python: - - "2.7" - - "3.4" - - "3.5" - - "3.6" +- 2.7 +- 3.4 +- 3.5 +- &main_python_version 3.6 +before_install: +- pip install -U pip setuptools install: - - if [[ $TRAVIS_PYTHON_VERSION == 3.5 || $TRAVIS_PYTHON_VERSION == 3.6 ]]; then pip install aiohttp==2.0.6 asynctest==0.10.0; fi - - pip install -q pep8==1.6.2 +- pip install -r test-requirements-py3.txt script: - - pep8 . - - python setup.py test +- python setup.py test + +jobs: + fast_finish: true + + include: + - stage: &lint_stage_name lint + python: *main_python_version + install: + - pip install pep8==1.6.2 + script: + - pep8 . + + - stage: &deploy_stage_name deploy to PYPI (triggered only for tagged commits) + python: *main_python_version + before_install: [] + script: skip + deploy: + provider: pypi + distribution: sdist bdist_wheel + user: dblack + password: + secure: YOUR_ENCRYPTED_PASSWORD_HERE_https://docs.travis-ci.com/user/encryption-keys/ + # Since commit https://github.com/travis-ci/dpl/commit/90b5e39 + # it is default that Travis PYPI provider has `skip_upload_docs: true` + # set by default. + on: + tags: true + all_branches: true + +stages: +- *lint_stage_name +- test +- name: *deploy_stage_name + if: tag IS present diff --git a/setup.py b/setup.py index c6e6cc7..0a0dd33 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ setup( - setup_requires=['pbr==1.8.1'], + setup_requires=['pbr==3.1.1'], pbr=True, test_suite='nose.collector', platforms=['any'], diff --git a/test-requirements-py3.txt b/test-requirements-py3.txt new file mode 100644 index 0000000..44883dc --- /dev/null +++ b/test-requirements-py3.txt @@ -0,0 +1,2 @@ +aiohttp>=2.0,<2.3; python_version>="3.4" +asynctest==0.10.0; python_version>="3.4"