-
Notifications
You must be signed in to change notification settings - Fork 54
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 TOML support to the config parser #580
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #580 +/- ##
=======================================
Coverage 74.73% 74.74%
=======================================
Files 288 288
Lines 23915 23928 +13
=======================================
+ Hits 17874 17884 +10
- Misses 6041 6044 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
pyproject.toml
Outdated
@@ -73,6 +73,7 @@ full = [ | |||
# | |||
# Until such time that this dependency can be installed through | |||
# flow.record, we define it as a dependency of dissect.target. | |||
"tomli; python_version<'3.11'", |
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.
Can you put this above the comment? The comment applies to the zstandard dependency.
dissect/target/helpers/configutil.py
Outdated
TOML = True | ||
except ImportError: | ||
TOML = False |
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.
TOML = True | |
except ImportError: | |
TOML = False | |
HAS_TOML = True | |
except ImportError: | |
HAS_TOML = False |
To be consistent with other places where we have this pattern.
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.
The PY_YAML one will be handled with https://github.com/fox-it/dissect.target/pull/563/files
dissect/target/helpers/configutil.py
Outdated
"""Parses a Toml file.""" | ||
|
||
def parse_file(self, fh: TextIO) -> None: | ||
if TOML: |
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.
if TOML: | |
if HAS_TOML: |
pyproject.toml
Outdated
"zstandard", | ||
"tomli; python_version<'3.11'", |
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.
Now it's no longer in alphabetical order 😉
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.
fixed :)
(DIS-2598)