From 0e72f5fab96275c23e91e571cc3fc8fb903b8ef5 Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Fri, 14 Apr 2023 07:46:00 -0400 Subject: [PATCH] python3Packages.trino-python-client: init at 0.322.0 --- .../trino-python-client/default.nix | 81 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 83 insertions(+) create mode 100644 pkgs/development/python-modules/trino-python-client/default.nix diff --git a/pkgs/development/python-modules/trino-python-client/default.nix b/pkgs/development/python-modules/trino-python-client/default.nix new file mode 100644 index 000000000000..479832bf9564 --- /dev/null +++ b/pkgs/development/python-modules/trino-python-client/default.nix @@ -0,0 +1,81 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub + # build +, setuptools + # required +, pytz +, requests +, tzlocal + # optional +, requests-kerberos +, sqlalchemy +, keyring + # tests +, pytestCheckHook +, httpretty +}: + +buildPythonPackage rec { + pname = "trino-python-client"; + version = "0.322.0"; + format = "setuptools"; + + src = fetchFromGitHub { + repo = pname; + owner = "trinodb"; + rev = "refs/tags/${version}"; + hash = "sha256-Hl88Keavyp1QBw67AFbevy/btzNs7UlsKQ93K02YgLM="; + }; + + nativeBuildInputs = [ + setuptools + ]; + + propagatedBuildInputs = [ + pytz + requests + tzlocal + ]; + + passthru.optional-dependencies = lib.fix (self: { + kerberos = [ + requests-kerberos + ]; + sqlalchemy = [ + sqlalchemy + ]; + external-authentication-token-cache = [ + keyring + ]; + all = self.kerberos ++ self.sqlalchemy; + }); + + nativeCheckInputs = [ + httpretty + pytestCheckHook + ] ++ passthru.optional-dependencies.all; + + pythonImportsCheck = [ + "trino" + ]; + + disabledTestPaths = [ + # these all require a running trino instance + "tests/integration/test_types_integration.py" + "tests/integration/test_dbapi_integration.py" + "tests/integration/test_sqlalchemy_integration.py" + ]; + + pytestFlagsArray = [ + "-k 'not auth'" + ]; + + meta = with lib; { + changelog = "https://github.com/trinodb/trino-python-client/blob/${version}/CHANGES.md"; + description = "Client for the Trino distributed SQL Engine"; + homepage = "https://github.com/trinodb/trino-python-client"; + license = licenses.asl20; + maintainers = with maintainers; [ cpcloud ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 75c879008fb6..b9de6908fd28 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -11987,6 +11987,8 @@ self: super: with self; { trimesh = callPackage ../development/python-modules/trimesh { }; + trino-python-client = callPackage ../development/python-modules/trino-python-client { }; + trio = callPackage ../development/python-modules/trio { inherit (pkgs) coreutils; };