Files
website-v2/libraries/management/commands/update_libraries.py
Lacey Williams Henschel 214f37986b Streamline import commands and add docs
Add data JSONField to LibraryVersion model

Add fields to library list admin display

Add commands to update authors and maintainers individually

Exclude data JSONField from view querysets

Silence some output from the library-version import management command

Remove unused field from the library-version import management command

Save library-versions more cleanly in the library-version import management command

Remove loading maintainers from the import command, since they now have their own command

Add docs for new commands

Add boost_setup command to run one command to import all data

Add docs on first-time data import

Better exception handling, quieter flow, reduce GH API calls

Graceful handling if there is not a github repo

Pass most recent 12 months to commit counts command

Add some user-friendly output to setup command
2023-09-19 11:17:05 -07:00

22 lines
712 B
Python

import djclick as click
from libraries.github import LibraryUpdater
@click.command()
@click.option("--local", is_flag=True, default=False)
@click.option("--token", is_flag=False, help="Github API token")
def command(local, token):
"""
Calls the LibraryUpdater, which retrieves the active boost libraries
from the Boost repo and updates the models in our database with the latest
information on that library (repo) from GitHub.
"""
click.secho(
"Updating libraries -- expect to wait 1-2 minutes before seeing output",
fg="green",
)
updater = LibraryUpdater(token=token)
updater.update_libraries()
click.secho("Finished importing libraries.", fg="green")