-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add .cfg/.ini params parser #10175
Add .cfg/.ini params parser #10175
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #10175 +/- ##
==========================================
+ Coverage 90.61% 90.64% +0.02%
==========================================
Files 499 501 +2
Lines 37880 37992 +112
Branches 5505 5414 -91
==========================================
+ Hits 34326 34436 +110
Misses 2912 2912
- Partials 642 644 +2 ☔ View full report in Codecov by Sentry. |
7ec3d27
to
945c69c
Compare
@percevalw, thank you for taking the time to create the pull request. Unfortunately, I'm leaning towards declining this PR as it will be difficult for us to maintain as the configuration parsing scope increases. This is because:
We are a small team, and we have struggled to maintain all the implemented params formats, especially in the case of Python parsing, which has been left unmaintained for an extended period. Given that, I'm hesitant to introduce one more format, particularly one with a scope that may potentially increase over time at this time. |
Hi, thank you for your review. I understand the difficulty of maintaining a very specific feature like this one. Would you be open in this case to considering a third party serialization ecosystem, using entry points for example? For instance, having in a "my-custom-dvc-ini-serializer" package a pyproject.toml field looking like the following: [project.entry-points."dvc_serializers"]
"cfg" = "my_custom_dvc_ini_serializer" with ... # content of serialize/__init__.py
import sys
from importlib.metadata import entry_points
for ep in entry_points(group='dvc_serializers'):
ext = ep.load()
PARSERS.update(ext.PARSERS)
LOADERS.update(ext.LOADERS)
MODIFIERS.update(ext.MODIFIERS)
DUMPERS.update(ext.DUMPERS) |
@percevalw, unfortunately, we cannot provide a stable API/hook for the config API. The While I do understand your use case, we don't see the demand or interests in #7122. There has been discussion about providing an API in #6506 before, and reusing the current utilities might lock us in when we come to improve parameters' workflow in the future. |
Closing as stale. |
Hi,
Following #7122, this PR adds support for
.ini
/.cfg
files (INI format).While we don't assume that nested sections of INI files follow the same convention as TOML (i.e.,
[section.nested]
), we still parse them as nested dictionaries because it should not affect non-nested configurations and it allows more complex overrides on files that do present nesting (àla spaCyconfig.cfg
files).Documentation PR: iterative/dvc.org#5060
❗ I have followed the Contributing to DVC checklist.
📖 If this PR requires documentation updates, I have created a separate PR (or issue, at least) in dvc.org and linked it here: