From 876e552e4bab79da96967628c1eea4333eba9efb Mon Sep 17 00:00:00 2001 From: Michael Liu Date: Tue, 26 Sep 2023 08:56:05 -0700 Subject: [PATCH 01/11] chore: Add pylint GitHub Action --- .github/workflows/client-lint.yaml | 38 ++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/client-lint.yaml diff --git a/.github/workflows/client-lint.yaml b/.github/workflows/client-lint.yaml new file mode 100644 index 0000000000..17c8819b60 --- /dev/null +++ b/.github/workflows/client-lint.yaml @@ -0,0 +1,38 @@ +name: Python package + +on: + push: + paths: + - client/verta/verta/**.py + +jobs: + lint: + runs-on: ubuntu-latest + defaults: + run: + working-directory: client/verta + + strategy: + matrix: + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + cache: "pip" + + - name: Install verta + run: python -m pip install . + + - name: Import verta + run: python -c 'from verta import Client' + + - name: Install pylint + run: python -m pip install pylint + + - name: Run pylint + run: pylint --disable=R,C,W verta From d567c178c086c592e1ae21b7a7b56e60d4a83b64 Mon Sep 17 00:00:00 2001 From: Michael Liu Date: Tue, 26 Sep 2023 08:58:25 -0700 Subject: [PATCH 02/11] Break client --- client/verta/verta/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/verta/verta/client.py b/client/verta/verta/client.py index 6e9e097ca6..1bd8ad2e30 100644 --- a/client/verta/verta/client.py +++ b/client/verta/verta/client.py @@ -210,7 +210,7 @@ def __init__( socket = "{}:{}".format(socket, port) scheme = back_end_url.scheme or ("https" if ".verta.ai" in socket else "http") - conn = _utils.Connection( + conn = _utils.Connection scheme=scheme, socket=socket, max_retries=max_retries, From 47f50ad336eb86e7a777afde861249ff05f65e45 Mon Sep 17 00:00:00 2001 From: Michael Liu Date: Tue, 26 Sep 2023 09:00:30 -0700 Subject: [PATCH 03/11] Revert "Break client" This reverts commit d567c178c086c592e1ae21b7a7b56e60d4a83b64. --- client/verta/verta/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/verta/verta/client.py b/client/verta/verta/client.py index 1bd8ad2e30..6e9e097ca6 100644 --- a/client/verta/verta/client.py +++ b/client/verta/verta/client.py @@ -210,7 +210,7 @@ def __init__( socket = "{}:{}".format(socket, port) scheme = back_end_url.scheme or ("https" if ".verta.ai" in socket else "http") - conn = _utils.Connection + conn = _utils.Connection( scheme=scheme, socket=socket, max_retries=max_retries, From 1eb1586abe3449a7adafbfce15e42298e6698df4 Mon Sep 17 00:00:00 2001 From: Michael Liu Date: Tue, 26 Sep 2023 09:10:36 -0700 Subject: [PATCH 04/11] Set name and on --- .github/workflows/client-lint.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/client-lint.yaml b/.github/workflows/client-lint.yaml index 17c8819b60..3996effdf3 100644 --- a/.github/workflows/client-lint.yaml +++ b/.github/workflows/client-lint.yaml @@ -1,7 +1,14 @@ -name: Python package +name: Python client lint on: + pull_request: + types: [opened, reopened, synchronize] + paths: + - client/verta/verta/**.py push: + branches: + - main + - "release/*" paths: - client/verta/verta/**.py From c38d1a53c64d98ecfa1545f89c643217dba555b3 Mon Sep 17 00:00:00 2001 From: Michael Liu Date: Tue, 26 Sep 2023 09:10:49 -0700 Subject: [PATCH 05/11] Revert "Revert "Break client"" This reverts commit 47f50ad336eb86e7a777afde861249ff05f65e45. --- client/verta/verta/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/verta/verta/client.py b/client/verta/verta/client.py index 6e9e097ca6..1bd8ad2e30 100644 --- a/client/verta/verta/client.py +++ b/client/verta/verta/client.py @@ -210,7 +210,7 @@ def __init__( socket = "{}:{}".format(socket, port) scheme = back_end_url.scheme or ("https" if ".verta.ai" in socket else "http") - conn = _utils.Connection( + conn = _utils.Connection scheme=scheme, socket=socket, max_retries=max_retries, From d4691f64803cc48c079e82572b8c7bfe93c182f8 Mon Sep 17 00:00:00 2001 From: Michael Liu Date: Tue, 26 Sep 2023 09:15:19 -0700 Subject: [PATCH 06/11] Revert "Revert "Revert "Break client""" This reverts commit c38d1a53c64d98ecfa1545f89c643217dba555b3. --- client/verta/verta/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/verta/verta/client.py b/client/verta/verta/client.py index 1bd8ad2e30..6e9e097ca6 100644 --- a/client/verta/verta/client.py +++ b/client/verta/verta/client.py @@ -210,7 +210,7 @@ def __init__( socket = "{}:{}".format(socket, port) scheme = back_end_url.scheme or ("https" if ".verta.ai" in socket else "http") - conn = _utils.Connection + conn = _utils.Connection( scheme=scheme, socket=socket, max_retries=max_retries, From 5021c291086695be36eac8bc874b1bc3adc69016 Mon Sep 17 00:00:00 2001 From: Michael Liu Date: Tue, 26 Sep 2023 09:17:07 -0700 Subject: [PATCH 07/11] Don't break client --- client/verta/verta/registry/errors.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/verta/verta/registry/errors.py b/client/verta/verta/registry/errors.py index e19da0904f..eecf247572 100644 --- a/client/verta/verta/registry/errors.py +++ b/client/verta/verta/registry/errors.py @@ -17,7 +17,7 @@ class ModelError(Exception): def __init__(self, message, http_code, include_stacktrace=False): if http_code >= 500 or http_code < 400: raise ValueError("error codes must fall in the 4XX range") - self.message = message self.http_code = http_code + self.message = message self.include_stacktrace = include_stacktrace super(ModelError, self).__init__(self.message) From c5317ad252e43c9342b9a568ed6c1c433aaf0901 Mon Sep 17 00:00:00 2001 From: Michael Liu Date: Tue, 26 Sep 2023 09:18:45 -0700 Subject: [PATCH 08/11] Revert "Don't break client" This reverts commit 5021c291086695be36eac8bc874b1bc3adc69016. --- client/verta/verta/registry/errors.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/verta/verta/registry/errors.py b/client/verta/verta/registry/errors.py index eecf247572..e19da0904f 100644 --- a/client/verta/verta/registry/errors.py +++ b/client/verta/verta/registry/errors.py @@ -17,7 +17,7 @@ class ModelError(Exception): def __init__(self, message, http_code, include_stacktrace=False): if http_code >= 500 or http_code < 400: raise ValueError("error codes must fall in the 4XX range") - self.http_code = http_code self.message = message + self.http_code = http_code self.include_stacktrace = include_stacktrace super(ModelError, self).__init__(self.message) From efac6f08e4a3580e7b228581e3a00191319571b2 Mon Sep 17 00:00:00 2001 From: Michael Liu Date: Tue, 26 Sep 2023 09:18:57 -0700 Subject: [PATCH 09/11] Always lint mainline --- .github/workflows/client-lint.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/client-lint.yaml b/.github/workflows/client-lint.yaml index 3996effdf3..aa0e86c819 100644 --- a/.github/workflows/client-lint.yaml +++ b/.github/workflows/client-lint.yaml @@ -9,8 +9,6 @@ on: branches: - main - "release/*" - paths: - - client/verta/verta/**.py jobs: lint: From d77a851188db3cac61d2906525390154a3ecf21f Mon Sep 17 00:00:00 2001 From: Michael Liu Date: Tue, 26 Sep 2023 09:19:29 -0700 Subject: [PATCH 10/11] Revert "Revert "Don't break client"" This reverts commit c5317ad252e43c9342b9a568ed6c1c433aaf0901. --- client/verta/verta/registry/errors.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/verta/verta/registry/errors.py b/client/verta/verta/registry/errors.py index e19da0904f..eecf247572 100644 --- a/client/verta/verta/registry/errors.py +++ b/client/verta/verta/registry/errors.py @@ -17,7 +17,7 @@ class ModelError(Exception): def __init__(self, message, http_code, include_stacktrace=False): if http_code >= 500 or http_code < 400: raise ValueError("error codes must fall in the 4XX range") - self.message = message self.http_code = http_code + self.message = message self.include_stacktrace = include_stacktrace super(ModelError, self).__init__(self.message) From 103d2e742167300775772f69febeeb6b8c2112b5 Mon Sep 17 00:00:00 2001 From: Michael Liu Date: Tue, 26 Sep 2023 09:21:00 -0700 Subject: [PATCH 11/11] Revert "Revert "Revert "Don't break client""" This reverts commit d77a851188db3cac61d2906525390154a3ecf21f. --- client/verta/verta/registry/errors.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/verta/verta/registry/errors.py b/client/verta/verta/registry/errors.py index eecf247572..e19da0904f 100644 --- a/client/verta/verta/registry/errors.py +++ b/client/verta/verta/registry/errors.py @@ -17,7 +17,7 @@ class ModelError(Exception): def __init__(self, message, http_code, include_stacktrace=False): if http_code >= 500 or http_code < 400: raise ValueError("error codes must fall in the 4XX range") - self.http_code = http_code self.message = message + self.http_code = http_code self.include_stacktrace = include_stacktrace super(ModelError, self).__init__(self.message)