From 2543b11c1061c58c20b31e353aa844eb875319b7 Mon Sep 17 00:00:00 2001 From: Matt Jia Date: May 22 2017 05:11:07 +0000 Subject: fix development setup --- diff --git a/MANIFEST.in b/MANIFEST.in index 73382b0..8616f82 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -5,7 +5,7 @@ include requirements.txt include pytest.ini include tests/*.py tests/client_secrets.json include tox.ini -include runapp.py +include run-dev-server.py include fedmsg.d/*.py recursive-include systemd * recursive-include conf * diff --git a/README.md b/README.md index 7faa043..dbc4352 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Install the project: Run the server: - $ DEV=true python runapp.py + $ python run-dev-server.py The server is now running at and API calls can be sent to . All data is stored inside `/var/tmp/waiverdb_db.sqlite`. diff --git a/docs/developer-guide.rst b/docs/developer-guide.rst index 6a91d19..b708818 100644 --- a/docs/developer-guide.rst +++ b/docs/developer-guide.rst @@ -18,7 +18,7 @@ Install the project:: Run the server:: - $ DEV=true python runapp.py + $ python run-dev-server.py The server is now running at on `localhost port 5004`_. Consult the :ref:`rest-api` for available API calls. All data is stored inside diff --git a/requirements.txt b/requirements.txt index d5c9310..750ac6a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,13 +2,15 @@ # you can install these as RPMs instead of pypi packages. fedmsg[consumers,commands] +m2crypto +m2ext Flask Flask-RESTful Flask-SQLAlchemy SQLAlchemy kerberos >= 1.1.1 flask-oidc - +systemd # packages for the unit tests pytest >= 2.4.2 mock diff --git a/run-dev-server.py b/run-dev-server.py new file mode 100644 index 0000000..62fbb32 --- /dev/null +++ b/run-dev-server.py @@ -0,0 +1,23 @@ +#!/usr/bin/python + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# + +from waiverdb.app import create_app, init_db + +if __name__ == '__main__': + app = create_app('waiverdb.config.DevelopmentConfig') + init_db(app) + app.run( + host=app.config['HOST'], + port=app.config['PORT'], + debug=app.config['DEBUG'], + ) diff --git a/runapp.py b/runapp.py deleted file mode 100644 index 77e766c..0000000 --- a/runapp.py +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/python -# -# runapp.py - script to facilitate running the waiverdb app from the CLI - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# - -from waiverdb.app import create_app, init_db - -if __name__ == '__main__': - app = create_app() - init_db(app) - app.run( - host=app.config['HOST'], - port=app.config['PORT'], - debug=app.config['DEBUG'], - )