-
Notifications
You must be signed in to change notification settings - Fork 41
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
Support TOML as a configuration file format alongside CFG/INI. #560
Conversation
27f381b
to
66dcebd
Compare
Codecov Report
@@ Coverage Diff @@
## master #560 +/- ##
========================================
Coverage 99.46% 99.47%
========================================
Files 82 84 +2
Lines 5444 5544 +100
========================================
+ Hits 5415 5515 +100
Misses 29 29
Continue to review full report at Codecov.
|
66dcebd
to
b816e71
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Using Annif efficiently with DVC requires that DVC understands the Annif configuration file; the current INI-style format is not supported by DVC (see #547).
This PR adds support for TOML as a configuration file format alongside the current one (which still works). Unless the path to the configuration file has been set using the
ANNIF_PROJECTS
environment variable or the-p
command line option, the configuration will be read fromprojects.cfg
if it exists, otherwise fromprojects.toml
.The main difference in the configuration syntax is that TOML requires string values to be quoted, e.g.
instead of
The tomli parser is used for parsing project configuration files with a
.toml
extension. It's a very minimal read-only, pure Python TOML parser; in the future, similar functionality (based on tomli) may be included in the Python standard library - see PEP 680.Fixes #547
Opening as draft PR to get early feedback from CI tools. Probably some refactoring will be necessary, as well as additional unit tests.