-
-
Notifications
You must be signed in to change notification settings - Fork 813
Description
We migrated plugin settings from metadata.yaml to datasette.yaml in:
See b2ec871
This is a breaking change - Datasette currently shows an error if you attempt to start it with a metadata file that includes a "plugins" block:
datasette/datasette/utils/__init__.py
Lines 1275 to 1287 in b466749
| def fail_if_plugins_in_metadata(metadata: dict, filename=None): | |
| """If plugin config is inside metadata, raise an Exception""" | |
| if metadata is not None and metadata.get("plugins") is not None: | |
| suggested_extension = ( | |
| ".yaml" | |
| if filename is not None | |
| and (filename.endswith(".yaml") or filename.endswith(".yml")) | |
| else ".json" | |
| ) | |
| raise Exception( | |
| f'Datasette no longer accepts plugin configuration in --metadata. Move your "plugins" configuration blocks to a separate file - we suggest calling that datasette.{suggested_extension} - and start Datasette with datasette -c datasette.{suggested_extension}. See https://docs.datasette.io/en/latest/configuration.html for more details.' | |
| ) | |
| return metadata |
This turns out to be hugely inconvenient - way more than I expected!
So... I'm going to change this policy such that, while the documentation recommends putting plugin settings in datasette.yaml (see https://docs.datasette.io/en/latest/configuration.html) it continues to work with plugin settings in metadata.yaml/json - it shows a warning message and then treats them as if they were in config instead.
This will make the upgrade to Datasette 1.08a and beyond less painful for people (myself included).