# HG changeset patch # User Paul Fisher # Date 1569784218 14400 # Node ID e7c8dcc5fc15ef86e512b871d7bfcdea4671df72 # Parent b42c4bfe57c7d967d72c50033d492daf4dd6fc17 Make the weather server pip-installable and locally runnable. diff -r b42c4bfe57c7 -r e7c8dcc5fc15 requirements.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/requirements.txt Sun Sep 29 15:10:18 2019 -0400 @@ -0,0 +1,5 @@ +attrs +flask +flup +pymongo +pytz diff -r b42c4bfe57c7 -r e7c8dcc5fc15 setup.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/setup.py Sun Sep 29 15:10:18 2019 -0400 @@ -0,0 +1,16 @@ +import setuptools + +setuptools.setup( + name='weather-server', + version='0.0.1', + packages=setuptools.find_packages(), + python_requires='>=3.7', + install_requires=[ + 'attrs', + 'flask', + 'flup', + 'pymongo', + 'pytz', + ], + setup_requires=['wheel'], +) diff -r b42c4bfe57c7 -r e7c8dcc5fc15 weather_server/server.py --- a/weather_server/server.py Sun Sep 29 11:52:48 2019 -0400 +++ b/weather_server/server.py Sun Sep 29 15:10:18 2019 -0400 @@ -1,6 +1,7 @@ +import hmac + import bson import flask -import hmac from . import common from . import locations @@ -65,3 +66,13 @@ date=date) return app + + +def main(argv): + """Main function for a simple local demo.""" + app = server.build_app(argv[0]) + app.run(host='0.0.0.0') + + +if __name__ == '__main__': + main(sys.argv[1:])