Skip to content

Configuration directory mode#739

Merged
simonw merged 6 commits intomasterfrom
configure-from-directory
Apr 27, 2020
Merged

Configuration directory mode#739
simonw merged 6 commits intomasterfrom
configure-from-directory

Conversation

@simonw
Copy link
Owner

@simonw simonw commented Apr 26, 2020

Refs #731

TODO:

  • Decide how to combine explicit command-line options with items detected from the directory structure
  • Add unit tests
  • Implement inspect-data.json mechanism for populating immutables
  • Add documentation

@simonw
Copy link
Owner Author

simonw commented Apr 26, 2020

I think ALL explicit options should over-ride options that were detected in the directory structure. This means my current implementation isn't quite right - using a class method makes it hard to merge the details with the explicit options passed to the CLI function.

@simonw
Copy link
Owner Author

simonw commented Apr 27, 2020

I'm going to add a Datasette(config_dir=".") parameter which initializes from the given directory, allowing other parameters to over-ride it.

datasette/app.py Outdated
Comment on lines 172 to 173
# TODO: Use 'inspect-data.json' to decide on immutables
immutables = immutables or []
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If inspect-data.json is present and a database file is listed there, treat that file as immutable.

@simonw
Copy link
Owner Author

simonw commented Apr 27, 2020

I think documentation goes on https://datasette.readthedocs.io/en/stable/config.html - but I'm going to need to re-arrange that page to fit in a section about configuration directories.

I'll move the existing list of settings into a "configration options" section.

@simonw simonw changed the title WIP implementation of configure directory Configuration directory mode Apr 27, 2020
@simonw simonw marked this pull request as ready for review April 27, 2020 16:22
@simonw simonw merged commit 25014ca into master Apr 27, 2020
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