diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c36c9a30..8c2141e7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -72,6 +72,14 @@ jobs: cache: "pip" cache-dependency-path: setup.py - name: Install dependencies + if: matrix.python != 'pypy-3.9' && matrix.python != 'pypy-3.10' + run: | + sudo apt-get update + sudo apt-get install libkrb5-dev + pip install wheel + pip install .[tests,gssapi,orjson] sqlalchemy${{ matrix.sqlalchemy }} + - name: Install dependencies in pypy + if: matrix.python == 'pypy-3.9' || matrix.python == 'pypy-3.10' run: | sudo apt-get update sudo apt-get install libkrb5-dev diff --git a/setup.py b/setup.py index e497ab36..e196e49d 100755 --- a/setup.py +++ b/setup.py @@ -32,6 +32,7 @@ # PyPy compatibility issue https://github.com/jborean93/pykrb5/issues/49 "krb5 == 0.5.1"] sqlalchemy_require = ["sqlalchemy >= 1.3"] +orjson_require = ["orjson >= 3.0.0"] external_authentication_token_cache_require = ["keyring"] # We don't add localstorage_require to all_require as users must explicitly opt in to use keyring. @@ -96,6 +97,7 @@ "kerberos": kerberos_require, "gssapi": gssapi_require, "sqlalchemy": sqlalchemy_require, + "orjson": orjson_require, "tests": tests_require, "external-authentication-token-cache": external_authentication_token_cache_require, }, diff --git a/trino/client.py b/trino/client.py index 7cc1f0f2..7404bf5e 100644 --- a/trino/client.py +++ b/trino/client.py @@ -39,7 +39,6 @@ import base64 import copy import functools -import json import os import random import re @@ -84,6 +83,11 @@ from trino.mapper import RowMapper from trino.mapper import RowMapperFactory +try: + import orjson as json +except ImportError: + import json + __all__ = [ "ClientSession", "TrinoQuery",