Skip to content

publish_subcommand hook + default plugins mechanism, used for publish heroku/now#349

Merged
simonw merged 2 commits intomasterfrom
publish-plugins
Jul 26, 2018
Merged

publish_subcommand hook + default plugins mechanism, used for publish heroku/now#349
simonw merged 2 commits intomasterfrom
publish-plugins

Conversation

@simonw
Copy link
Owner

@simonw simonw commented Jul 26, 2018

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 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
@simonw simonw changed the title Extract publish heroku/now implementations into default plugins publish_subcommand hook + default plugins mechanism, now used for publish heroku/now Jul 26, 2018
@simonw simonw changed the title publish_subcommand hook + default plugins mechanism, now used for publish heroku/now publish_subcommand hook + default plugins mechanism, used for publish heroku/now Jul 26, 2018
@simonw simonw merged commit dbbe707 into master Jul 26, 2018
@simonw simonw deleted the publish-plugins branch July 26, 2018 05:16
@simonw
Copy link
Owner Author

simonw commented Jul 26, 2018

Documentation here: http://datasette.readthedocs.io/en/latest/plugins.html#publish-subcommand-publish

The best way to write a new publish plugin is to check out how the Heroku and Now default plugins are implemented: https://github.com/simonw/datasette/tree/master/datasette/publish

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant