Uploaded image for project: 'Zapped: AcousticBrainz'
  1. Zapped: AcousticBrainz
  2. AB-317

Use flask CLI for management commands and tools

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Normal Normal
    • None
    • None
    • None
    • None

      With the switch to MetaBrainz' CustomFlask we now load various configuration files when we create an app. As a result of this, we no longer want to import specific config files directly in separate util commands.

      Additionally, having all connections to external services in a single place (create_app) makes it easier to make changes to the way that we configure these services.

      Recent versions of flask have a CLI interface: http://flask.pocoo.org/docs/0.12/cli/

      Using this will allow us to automatically start up a flask context, complete with configuration settings and connections to external services (database, etc) allowing us to use them for both existing management commands, and long running processes (such as the hl calculator or dataset evaluator).

      By running commands from a single entry point we no longer have to modify sys.path, or remember to run python -m from the correct directory to run a command.

      The flask CLI is based on Click, which we already use in manage.py for AB. Altering this to use the flask CLI shouldn't be a large job.

            iliekcomputers Param Singh
            alastairp Alastair Porter
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Version Package