Create requests-async based TestClient, remove aiohttp dependency, drop Python 3.5

Update all tests to be compatible with requests-async
Cleanup testing client changes with black and isort
Remove Python 3.5 and other meta doc cleanup
rename pyproject and fix pep517 error
Add black config to tox.ini
Cleanup tests and remove aiohttp
tox.ini change for easier development commands
Remove aiohttp from changelog and requirements
Cleanup imports and Makefile
This commit is contained in:
Adam Hopkins
2019-04-24 00:44:42 +03:00
parent 6a4a3f617f
commit ccd4c9615c
56 changed files with 649 additions and 578 deletions

View File

@@ -1,10 +1,13 @@
# Run with python3 simple_server.py PORT
from aiohttp import web
import asyncio
import sys
import uvloop
import ujson as json
import uvloop
from aiohttp import web
loop = uvloop.new_event_loop()
asyncio.set_event_loop(loop)

View File

@@ -1,8 +1,9 @@
# Run with: gunicorn --workers=1 --worker-class=meinheld.gmeinheld.MeinheldWorker -b :8000 simple_server:app
import bottle
from bottle import route, run
import ujson
from bottle import route, run
@route("/")
def index():

View File

@@ -1,10 +1,13 @@
# Run with: python3 -O simple_server.py
import asyncio
from kyoukai import Kyoukai, HTTPRequestContext
import logging
import ujson
import uvloop
from kyoukai import HTTPRequestContext, Kyoukai
loop = uvloop.new_event_loop()
asyncio.set_event_loop(loop)

View File

@@ -1,16 +1,18 @@
import asyncpg
import sys
import os
import inspect
import os
import sys
import timeit
import asyncpg
from sanic.response import json
currentdir = os.path.dirname(
os.path.abspath(inspect.getfile(inspect.currentframe()))
)
sys.path.insert(0, currentdir + "/../../../")
import timeit
from sanic.response import json
print(json({"test": True}).output())

View File

@@ -1,14 +1,16 @@
import sys
import os
import inspect
import os
import sys
from sanic import Sanic
from sanic.response import json
currentdir = os.path.dirname(
os.path.abspath(inspect.getfile(inspect.currentframe()))
)
sys.path.insert(0, currentdir + "/../../../")
from sanic import Sanic
from sanic.response import json
app = Sanic("test")

View File

@@ -1,15 +1,17 @@
import sys
import os
import inspect
import os
import sys
from sanic import Sanic
from sanic.exceptions import ServerError
from sanic.response import json, text
currentdir = os.path.dirname(
os.path.abspath(inspect.getfile(inspect.currentframe()))
)
sys.path.insert(0, currentdir + "/../../../")
from sanic import Sanic
from sanic.response import json, text
from sanic.exceptions import ServerError
app = Sanic("test")
@@ -56,8 +58,6 @@ def query_string(request):
)
import sys
app.run(host="0.0.0.0", port=sys.argv[1])

View File

@@ -1,5 +1,6 @@
# Run with: python simple_server.py
import ujson
from tornado import ioloop, web

View File

@@ -2,15 +2,16 @@
""" Minimal helloworld application.
"""
from wheezy.http import HTTPResponse
from wheezy.http import WSGIApplication
import ujson
from wheezy.http import HTTPResponse, WSGIApplication
from wheezy.http.response import json_response
from wheezy.routing import url
from wheezy.web.handlers import BaseHandler
from wheezy.web.middleware import bootstrap_defaults
from wheezy.web.middleware import path_routing_middleware_factory
import ujson
from wheezy.web.middleware import (
bootstrap_defaults,
path_routing_middleware_factory,
)
class WelcomeHandler(BaseHandler):