From 50d6d889dd266c41de5c6e48eb0c77730b2655f5 Mon Sep 17 00:00:00 2001 From: Samuel Colvin Date: Fri, 7 Dec 2018 20:43:21 +0000 Subject: [PATCH] remove aiohttp_debugtoolbar as requirement, uprev travis (#216) * remove aiohttp_debugtoolbar as requirement, uprev travis * fix matrix * allow 3.7 to fail for now :-( --- .travis.yml | 29 ++++++++++++++++++----------- Makefile | 2 +- README.rst | 2 +- aiohttp_devtools/runserver/serve.py | 9 +++++++-- setup.py | 1 - tests/requirements.txt | 1 + 6 files changed, 28 insertions(+), 16 deletions(-) diff --git a/.travis.yml b/.travis.yml index 41961de8..1e8c8481 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,19 +5,26 @@ cache: pip services: - postgresql -python: -- '3.5' -- '3.6' -- 'nightly' # currently 3.7 - -env: -# TODO keep this up to date -- 'AIOHTTP_VERSION=aiohttp==3.4.4' # WARNING: if you change this, change it in deploy too -- 'AIOHTTP_VERSION=https://github.com/aio-libs/aiohttp/archive/master.zip' - matrix: + include: + - python: '3.5' + env: 'AIOHTTP_VERSION=aiohttp==3.4.4' + - python: '3.6' + env: 'AIOHTTP_VERSION=aiohttp==3.4.4' # WARNING: if you change this, change it in deploy too + - python: '3.6' + env: 'AIOHTTP_VERSION=https://github.com/aio-libs/aiohttp/archive/master.zip' + - python: '3.7' + dist: xenial + sudo: required + env: 'AIOHTTP_VERSION=aiohttp==3.4.4' + - python: '3.8-dev' + dist: xenial + sudo: required + env: 'AIOHTTP_VERSION=aiohttp==3.4.4' + allow_failures: - - python: 'nightly' + - python: '3.8-dev' + - python: '3.7' # temporary until we can fix tests for 3.7 - env: 'AIOHTTP_VERSION=https://github.com/aio-libs/aiohttp/archive/master.zip' install: diff --git a/Makefile b/Makefile index 7dd8619e..5889bad2 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ .PHONY: install install: pip install -U setuptools pip - pip install -U . + pip install -e . pip install -r tests/requirements.txt grablib diff --git a/README.rst b/README.rst index 58cbb3ad..7d8c0a4b 100644 --- a/README.rst +++ b/README.rst @@ -115,7 +115,7 @@ First let's create a clean python environment to work in and install aiohttp-dev .. code:: shell mkdir my_new_app && cd my_new_app - virtualenv -p `which python3.5` env + virtualenv -p `which python3.7` env . env/bin/activate pip install aiohttp-devtools diff --git a/aiohttp_devtools/runserver/serve.py b/aiohttp_devtools/runserver/serve.py index c33ca1e2..bb7317a3 100644 --- a/aiohttp_devtools/runserver/serve.py +++ b/aiohttp_devtools/runserver/serve.py @@ -6,7 +6,6 @@ from pathlib import Path from typing import Optional -import aiohttp_debugtoolbar from aiohttp import WSMsgType, web from aiohttp.hdrs import LAST_MODIFIED from aiohttp.web import FileResponse, Response @@ -22,6 +21,12 @@ from .log_handlers import AccessLogger, fmt_size from .utils import MutableValue +try: + import aiohttp_debugtoolbar +except ImportError: # pragma: no cover + # aiohttp_debugtoolbar is not a required dependency + aiohttp_debugtoolbar = None + LIVE_RELOAD_HOST_SNIPPET = '\n\n' LIVE_RELOAD_LOCAL_SNIPPET = b'\n\n' JINJA_ENV = 'aiohttp_jinja2_environment' @@ -71,7 +76,7 @@ async def static_middleware(request, handler): dft_logger.debug('settings app static_root_url to "%s"', static_url) app['static_root_url'] = MutableValue(static_url) - if config.debug_toolbar: + if config.debug_toolbar and aiohttp_debugtoolbar: aiohttp_debugtoolbar.setup(app, intercept_redirects=False) diff --git a/setup.py b/setup.py index 2ef57796..e5b69f92 100644 --- a/setup.py +++ b/setup.py @@ -75,7 +75,6 @@ """, install_requires=[ 'aiohttp>=3.2.0', - 'aiohttp_debugtoolbar>=0.4.0', 'click>=6.6', 'isort>=4.3.3', 'Jinja2>=2.10', diff --git a/tests/requirements.txt b/tests/requirements.txt index d5d55b77..94ee8400 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,3 +1,4 @@ +aiohttp_debugtoolbar==0.5.0 click==7.0.0 coverage==4.5.2 docutils==0.14