mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
publish_subcommand hook + default plugins mechanism, used for publish heroku/now (#349)
This change introduces a new plugin hook, publish_subcommand, which can be used to implement new subcommands for the "datasette publish" command family. I've used this new hook to refactor out the "publish now" and "publish heroku" implementations into separate modules. I've also added unit tests for these two publishers, mocking the subprocess.call and subprocess.check_output functions. As part of this, I introduced a mechanism for loading default plugins. These are defined in the new "default_plugins" list inside datasette/app.py Closes #217 (Plugin support for datasette publish) Closes #348 (Unit tests for "datasette publish") Refs #14, #59, #102, #103, #146, #236, #347
This commit is contained in:
parent
3ac21c7498
commit
dbbe707841
15 changed files with 360 additions and 256 deletions
|
|
@ -7,14 +7,17 @@ docs_path = Path(__file__).parent / "docs"
|
|||
includes = (
|
||||
("serve", "datasette-serve-help.txt"),
|
||||
("package", "datasette-package-help.txt"),
|
||||
("publish", "datasette-publish-help.txt"),
|
||||
("publish now", "datasette-publish-now-help.txt"),
|
||||
("publish heroku", "datasette-publish-heroku-help.txt"),
|
||||
)
|
||||
|
||||
|
||||
def update_help_includes():
|
||||
for name, filename in includes:
|
||||
runner = CliRunner()
|
||||
result = runner.invoke(cli, [name, "--help"], terminal_width=88)
|
||||
result = runner.invoke(
|
||||
cli, name.split() + ["--help"], terminal_width=88
|
||||
)
|
||||
actual = "$ datasette {} --help\n\n{}".format(
|
||||
name, result.output
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue