Skip to content
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 pydantic models for borg 1.x's CLI (#8338) #8343

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

a-gn
Copy link

@a-gn a-gn commented Aug 26, 2024

This adds pydantic models for borg's CLI outputs (fixes #8338).

Sadly I can't try to run these tests locally; when trying to run tox or pip install borg I get OSError: pkg-config probably not installed: FileNotFoundError(2, 'No such file or directory').

@@ -24,9 +25,15 @@ def __init__(self, msgid=None):
self.id = self.operation_id()
self.msgid = msgid

def make_json(self, *, finished=False, **kwargs):
def make_json(self, *, finished=False, override_time: typing.Optional[float] = None, **kwargs):
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me know if you think this new argument is bad. The function is harder to test when it always takes time.time().

@a-gn
Copy link
Author

a-gn commented Aug 31, 2024

@ThomasWaldmann I just fixed the Python 3.10 union syntax, hopefully that's the last of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docs suggestion: pydantic models for borg's JSON output
1 participant