-
Notifications
You must be signed in to change notification settings - Fork 557
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
For future major releases, consider TOML over ConfigObj for pgclirc #1162
Comments
The last time I checked the TOML library for python it didn't have a way to preserve the comments in the file when we update it. For instance, we write to the config file when someone saves a named query. By using ConfigObj it allows us to preserve the comments in the file that a user might have added. With TOML if we read the config and write back the file it strips out the comments. I had filed an issue with the library author a while back, I don't think it has seen any movement though. |
Sorry to somewhat hijack this issue, but it's the only relevant thing I found while searching for comment preserving in the config file. Are user comments supposed to be preserved already, or is it something that's possible ("allows us to ...") but not yet supported by pgcli? For me this has never worked. Just did a quick test again (pgcli 3.0.0, configobj 5.0.6, Python 3.6, Linux) by saving a named query and any manually added comments in my config file still get lost (tested the "named queries", "alias_dsn", "main" and "data_formats" sections). If they're supposed to be preserved already I'll create a separate issue for it but first wanted to check if I understood correctly. |
@sevens-ef Indeed, comments in pgclirc are supposed to be preserved already. If this does not work for you, please create an issue to track the problem. |
Ok, thanks! I've been busy with other things but finally got around to it... |
ConfigObj fixes a lot of problems with INI, which isn't a real format, but AFAIK is a dead end in terms of adoption and indeed wider recognition as it's just one library with its own specification.
TOML resolves many of the same problems as ConfigObj and is seeing pretty widespread adoption (e.g. by the rust ecosystem, and indeed by modern python standards). Therefore it has better tooling available for it, is more recognisable, and is in wider use.
Changing config format is obviously a seriously breaking change. If there is interest in this transition, we could move to supporting both immediately, give a couple of minor versions' (Pending)DeprecationWarning, then actually deprecate it with a major version.
The text was updated successfully, but these errors were encountered: