Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to uninstall a plugin #72

Closed
Tracked by #74
simonw opened this issue Sep 8, 2021 · 7 comments
Closed
Tracked by #74

Ability to uninstall a plugin #72

simonw opened this issue Sep 8, 2021 · 7 comments

Comments

@simonw
Copy link
Owner

simonw commented Sep 8, 2021

@psychemedia in #67 (comment)

plugins: no option to uninstall plugin? (This raised a related issue for me that is more in scope of datasette-cluster-map. If I have that plugin installed, how can I plot markers explicitly (not clustered?) other than by going in to a high zoom level on the map?

@simonw
Copy link
Owner Author

simonw commented Sep 9, 2021

From #41 (comment)

@psychemedia
Copy link

Trying to enumerate possible situations:

  • installed (and being used)
  • not installed (in sense of py package not installed in current environment)
  • disabled (py package installed in environment "installed" in datasette, but not enabled eg for a particular database)
  • uninstalled (py package exists but is not "installed" in datasette)

@simonw
Copy link
Owner Author

simonw commented Sep 11, 2021

Part of #74.

@simonw
Copy link
Owner Author

simonw commented Sep 11, 2021

If I'm going to have default plugins and I'm going to let users uninstall them, I need a way of remembering what they uninstalled.

I quite like the idea of doing this as an audit log - so every time a user installs or uninstalls or upgrades a plugin we record that permanently somewhere. This could be really useful for debugging later on.

Obviously this should be a SQLite database somewhere. But what should it be called?

Some options:

  • prefs.db or preferences.db
  • config.db - could be confused with Datasette's concept of configuration (e.g plugin configuration)
  • settings.db - definitely confused with Datasette's --setting mechanism

So preferences.db is probably the best option - but do I risk confusion over preferences v.s. settings v.s. configuration v.s. metadata? And what if there's stuff I end up storing in there that doesn't classify as user preferences?

I could call it _desktop.db since it's the internal database for stuff relating to the Datasette Desktop app.

@simonw
Copy link
Owner Author

simonw commented Sep 11, 2021

One very slight catch: I need to be able to consult the _desktop database before the datasette process has started up in order to tell which plugins I should avoid installing.

Might have to do that with a custom datasette desktop_plugins /path/to/_desktop.db command using the new register_commands hook https://docs.datasette.io/en/latest/plugin_hooks.html#register-commands-cli

BUT... even that doesn't help me if the Datasette installation is completely corrupted and I need to do a fresh install.

I guess I could install datasette plus default plugins, but then before finally starting the server I could run datasette desktop_plugins --uninstalled-defaults to see if there are any plugins that I should uninstall again? Bit convoluted but it would work at least.

@simonw simonw removed this from the 0.2 - plugins and progress bars milestone Sep 11, 2021
@simonw
Copy link
Owner Author

simonw commented Sep 11, 2021

Dropping this from the next release milestone because the debug menu to reinstall Datasette exists as a workaround for the moment.

@simonw
Copy link
Owner Author

simonw commented Sep 11, 2021

Putting it back in the release but I'll disallow uninstall for default plugins right now - and label them as such in the plugin directory faceting interface:

simonw added a commit to simonw/datasette-app-support that referenced this issue Sep 11, 2021
simonw added a commit that referenced this issue Sep 11, 2021
Plus now passes list of default plugins through to the
server process as an environment variable.

Refs #72, simonw/datasette-app-support#12
@simonw simonw closed this as completed Sep 11, 2021
simonw added a commit that referenced this issue Sep 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants