From 7090cd4f0af0c01d446a7129a9bcff10685a6554 Mon Sep 17 00:00:00 2001 From: Iman Tabrizian Date: Wed, 29 May 2024 11:23:25 -0400 Subject: [PATCH 1/2] Add dummy client --- src/python/library/tritonclient/_client.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/python/library/tritonclient/_client.py b/src/python/library/tritonclient/_client.py index 6a521dc62..130c0ea40 100755 --- a/src/python/library/tritonclient/_client.py +++ b/src/python/library/tritonclient/_client.py @@ -83,3 +83,8 @@ def unregister_plugin(self): raise_error("No plugin has been registered.") self._plugin = None + + +class Client: + def __init__(self) -> None: + pass From 880f2a6e0d18e2b50b3d7cc9140815455ce0423e Mon Sep 17 00:00:00 2001 From: Iman Tabrizian Date: Wed, 29 May 2024 12:13:22 -0400 Subject: [PATCH 2/2] Add simple testing --- src/python/library/tests/test_client.py | 38 ++++++++++++++++++++++ src/python/library/tritonclient/_client.py | 4 +-- 2 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 src/python/library/tests/test_client.py diff --git a/src/python/library/tests/test_client.py b/src/python/library/tests/test_client.py new file mode 100644 index 000000000..3403322b0 --- /dev/null +++ b/src/python/library/tests/test_client.py @@ -0,0 +1,38 @@ +# Copyright 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of NVIDIA CORPORATION nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import unittest + +from tritonclient._client import Client + + +class TestClient(unittest.TestCase): + def test_client(self): + Client() + + +if __name__ == "__main__": + unittest.main() diff --git a/src/python/library/tritonclient/_client.py b/src/python/library/tritonclient/_client.py index 130c0ea40..cdf8fa211 100755 --- a/src/python/library/tritonclient/_client.py +++ b/src/python/library/tritonclient/_client.py @@ -85,6 +85,6 @@ def unregister_plugin(self): self._plugin = None -class Client: +class Client(InferenceServerClientBase): def __init__(self) -> None: - pass + super().__init__()