quetz
quetz copied to clipboard
Refactor conf system and cli
I would like to refactor both the configuration system and the cli to propose something more modular and leverage existing libs.
Motivations:
- replace the implementation of type checking, default value, required or not, section vs entry, by an existing lib doing that better
- have a modular and extensible config system that paves the way for having pluggable authenticators, storage, etc.
- benefit from a cli allowing by design args parsing and not only a config file
I think about traitlets
that provides all of those features.
It could be also very convenient to reuse/share some JupyterHub
implementations.
There is also pydantic
and the promising pydantic-cli
. That way we reuse the already installed pydantic
dep required by FastAPI
.
Looks like some jupyter
projects are also assessing pydantic
. See this issue.
I'm still surprised that traitlets
never gained so popular that pydantic
is. Is there some reasons explaining this difference of popularity that could help us to make a choice?
Do you have some thoughts about that @wolfv @SylvainCorlay ? @btel ? Any others?
I agree that configuration system could be better. I would not like to introduce another type checking library, mainly because of cognitive load for developers to learn two different libraries. I don't know either traitlets or pydantic to compare their relative benefits.