-
Notifications
You must be signed in to change notification settings - Fork 107
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
Replace clamd with clamav-client #1991
base: qa/1.x
Are you sure you want to change the base?
Conversation
This commit replaces [clamd 1.0.2] with [clamav-client 0.6.0], a modern fork of clamd that follows current Python practices and tooling. clamav-client is tested with supported versions of Python and avoids deprecated dependencies such as `pkg_resources` (which was removed in Python 3.12). clamav-client provides its own `Scanner` interface to handle integration with both `clamd` and `clamscan`, so Archivematica doesn't need to. Both backends are tested with integration tests. [clamd 1.0.2]: https://pypi.org/project/clamd/1.0.2/ [clamav-client 0.6.0]: https://pypi.org/project/clamav-client/0.6.0/
64e6d6b
to
5e71df3
Compare
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.
Thanks @sevein. This looks great!
|
||
|
||
# Map user-provided backend names from configuration to the corresponding | ||
# internal values used in the clamav_client package. Default to "clamscanner" if |
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.
# internal values used in the clamav_client package. Default to "clamscanner" if | |
# internal values used in the clamav_client package. Default to "clamdscanner" if |
mock.patch.object( | ||
result.__class__, | ||
"passed", | ||
new_callable=mock.PropertyMock, | ||
return_value=self.passed, | ||
).start() |
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.
Is this patch stopped implicitly?
def get_parser(): | ||
"""Return a ``Namespace`` with the parsed arguments.""" | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument("file_uuid", metavar="fileUUID") | ||
parser.add_argument("path", metavar="PATH", help="File or directory location") | ||
parser.add_argument("date", metavar="DATE") | ||
parser.add_argument( | ||
"task_uuid", metavar="taskUUID", help="Currently unused, feel free to ignore." | ||
) | ||
return parser |
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.
Should we remove this helper function if we're not using it?
This commit replaces clamd 1.0.2 with clamav-client 0.6.0, a modern fork of
clamd that follows current Python practices and tooling. clamav-client is tested
with supported versions of Python and avoids deprecated dependencies such as
pkg_resources
(which was removed in Python 3.12).clamav-client provides its own
Scanner
interface to handle integration withboth
clamd
andclamscan
, so Archivematica doesn't need to. Both backends aretested with integration tests.