From 52f6db2e810f49732c902811cfe88d434dbb01ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ko=C5=82odziejczak?= <31549762+mrl5@users.noreply.github.com> Date: Sat, 15 Oct 2022 10:27:07 +0200 Subject: [PATCH] fix(python-client): provide backwards compatibility down to python3.7 (#738) (#739) this reverts 79b176cbbd24cb37ab3833d94f14d21846ad5746 introducing alternative way of avoiding bug described in https://github.com/windmill-labs/windmill/issues/736#issuecomment-1279679730 the improvement here is that we're able to support more python versions now --- python-client/wmill/pyproject.toml | 2 +- python-client/wmill/wmill/client.py | 4 ++-- python-client/wmill_pg/pyproject.toml | 2 +- python-client/wmill_pg/wmill_pg/client.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/python-client/wmill/pyproject.toml b/python-client/wmill/pyproject.toml index 383086a43b..91c529102a 100644 --- a/python-client/wmill/pyproject.toml +++ b/python-client/wmill/pyproject.toml @@ -15,7 +15,7 @@ packages = [ include = ["wmill/py.typed"] [tool.poetry.dependencies] -python = "^3.10" +python = "^3.7" windmill-api = "^1.38.1" [build-system] diff --git a/python-client/wmill/wmill/client.py b/python-client/wmill/wmill/client.py index d6d2de5631..e0eda65403 100644 --- a/python-client/wmill/wmill/client.py +++ b/python-client/wmill/wmill/client.py @@ -27,9 +27,9 @@ class JobStatus(Enum): RUNNING = 2 COMPLETED = 3 -_client: AuthenticatedClient | None = None +_client: "AuthenticatedClient | None" = None -def create_client(base_url: str | None = None, token: str | None = None) -> AuthenticatedClient: +def create_client(base_url: "str | None" = None, token: "str | None" = None) -> AuthenticatedClient: env_base_url = os.environ.get("BASE_INTERNAL_URL") if env_base_url is not None: diff --git a/python-client/wmill_pg/pyproject.toml b/python-client/wmill_pg/pyproject.toml index c1f9394406..3464124344 100644 --- a/python-client/wmill_pg/pyproject.toml +++ b/python-client/wmill_pg/pyproject.toml @@ -15,7 +15,7 @@ packages = [ include = ["wmill_pg/py.typed"] [tool.poetry.dependencies] -python = "^3.10" +python = "^3.7" wmill = "^1.5.0" psycopg2-binary = "*" diff --git a/python-client/wmill_pg/wmill_pg/client.py b/python-client/wmill_pg/wmill_pg/client.py index 6fcb5987c1..73b5efc3fe 100644 --- a/python-client/wmill_pg/wmill_pg/client.py +++ b/python-client/wmill_pg/wmill_pg/client.py @@ -5,7 +5,7 @@ import wmill import psycopg2 -def query(query: str, connection: str | dict[str, Any] = "g/all/postgres") -> list[tuple[Any, ...]] | None: +def query(query: str, connection: "str | dict[str, Any]" = "g/all/postgres") -> "list[tuple[Any, ...]] | None": """ Query a postgres database using psycopg2 library underneath. See its documentation for more info.