Remove flask-script, move commands to click

click (http://click.pocoo.org/) is used by flask to run its cli args.
In removing flask_script (it's unmaintained), we had to migrate all our
commands to use click. This is a change for the better in my eyes - you
don't need to define the command in several places, and it makes
managing options a bit easier.

View diff with whitespace turned off unless you're a masochist.
This commit is contained in:
Leo Hemsted
2017-11-06 12:34:29 +00:00
parent 0df44040e3
commit 9f56dccdee
9 changed files with 300 additions and 331 deletions

View File

@@ -1,4 +1,3 @@
from flask_script import Manager, Server
from flask_migrate import Migrate, MigrateCommand
from app import (create_app, db, commands)
import os
@@ -16,11 +15,10 @@ os.environ['NOTIFY_API_ENVIRONMENT'] = configs[environment]
application = create_app()
manager = Manager(application)
migrate = Migrate(application, db)
manager.add_command('db', MigrateCommand)
manager.add_command('purge_functional_test_data', commands.PurgeFunctionalTestDataCommand)
manager.add_command('custom_db_script', commands.CustomDbScript)
application.add_command('db', MigrateCommand)
application.add_command('purge_functional_test_data', commands.PurgeFunctionalTestDataCommand)
application.add_command('custom_db_script', commands.CustomDbScript)
if __name__ == '__main__':
manager.run()