From 45ab2941d8a7b175c0d9e361997d553131df058a Mon Sep 17 00:00:00 2001 From: Ryan Barrett Date: Tue, 13 Dec 2022 11:21:34 -0800 Subject: [PATCH] don't hoist flask_server.init_flask into __init__.py since the Flask dependency is in an extra --- README.md | 4 ++-- lexrpc/__init__.py | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3af2366..69a136f 100644 --- a/README.md +++ b/README.md @@ -55,11 +55,11 @@ response.write_json(output) ## Flask server -To serve XRPC methods in a [Flask](https://flask.palletsprojects.com/) web app, first instantiate a [`Server`](https://lexrpc.readthedocs.io/en/latest/source/lexrpc.html#lexrpc.server.Server) and register method handlers as described above. Then, attach the server to your Flask app with [`init_flask`](https://lexrpc.readthedocs.io/en/latest/source/lexrpc.html#lexrpc.flask_server.init_flask). +To serve XRPC methods in a [Flask](https://flask.palletsprojects.com/) web app, first install the lexrpc package with the `flask` extra, eg `pip install lexrpc[flask]`. Then, instantiate a [`Server`](https://lexrpc.readthedocs.io/en/latest/source/lexrpc.html#lexrpc.server.Server) and register method handlers as described above. Finally, attach the server to your Flask app with [`flask_server.init_flask`](https://lexrpc.readthedocs.io/en/latest/source/lexrpc.html#lexrpc.flask_server.init_flask). ```py from flask import Flask -from lexrpc import init_flask +from lexrpc.flask_server import init_flask # instantiate a Server like above server = ... diff --git a/lexrpc/__init__.py b/lexrpc/__init__.py index 107f5a8..49da087 100644 --- a/lexrpc/__init__.py +++ b/lexrpc/__init__.py @@ -1,3 +1,2 @@ from .client import Client -from .flask_server import init_flask from .server import Server