From ff157f0a86b446aaf984a4cb43815a163cf8f425 Mon Sep 17 00:00:00 2001 From: Dan Yishai Date: Mon, 15 Apr 2024 18:50:33 +0300 Subject: [PATCH 1/5] Added python 3.11 and 3.12 to tests CI --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 180a5753b..610cdd05d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -27,7 +27,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.9", "3.10"] + python-version: ["3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v2 From 50e10992a51832593bc28b2743850aa17de95634 Mon Sep 17 00:00:00 2001 From: Dan Yishai Date: Thu, 18 Apr 2024 12:30:20 +0300 Subject: [PATCH 2/5] Updated python dependencies --- packages/opal-common/requires.txt | 2 +- packages/requires.txt | 2 +- requirements.txt | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/opal-common/requires.txt b/packages/opal-common/requires.txt index bbe8924a5..29afabb6c 100644 --- a/packages/opal-common/requires.txt +++ b/packages/opal-common/requires.txt @@ -7,4 +7,4 @@ pyjwt[crypto]>=2.4.0,<3 python-decouple>=3.6,<4 tenacity>=8.0.1,<9 datadog>=0.44.0, <1 -ddtrace>=2,<3 +ddtrace>=2.8.1,<3 diff --git a/packages/requires.txt b/packages/requires.txt index 9a6d1f4f3..5b291165b 100644 --- a/packages/requires.txt +++ b/packages/requires.txt @@ -4,7 +4,7 @@ typer>=0.4.1,<1 fastapi>=0.109.1,<1 fastapi_websocket_pubsub==0.3.7 fastapi_websocket_rpc>=0.1.21,<1 -gunicorn>=20.1.0,<21 +gunicorn>=22.0.0,<23 pydantic[email]>=1.9.1,<2 typing-extensions;python_version<'3.8' uvicorn[standard]>=0.17.6,<1 diff --git a/requirements.txt b/requirements.txt index 9e26dfe29..3c0d2e61e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,10 +1,10 @@ -e ./packages/opal-common -e ./packages/opal-client -e ./packages/opal-server -ipython +ipython>=8.10.0 pytest pytest-asyncio pytest-rerunfailures -wheel +wheel>=0.38.0 twine setuptools>=65.5.1 # not directly required, pinned by Snyk to avoid a vulnerability From 828598ad9d850a0d9c22dbcc8f66317f598d2188 Mon Sep 17 00:00:00 2001 From: Dan Yishai Date: Thu, 18 Apr 2024 12:32:19 +0300 Subject: [PATCH 3/5] Fixed closing files --- packages/opal-client/opal_client/client.py | 3 ++- packages/opal-common/opal_common/authentication/casting.py | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/opal-client/opal_client/client.py b/packages/opal-client/opal_client/client.py index 15f195b53..be8e5ca49 100644 --- a/packages/opal-client/opal_client/client.py +++ b/packages/opal-client/opal_client/client.py @@ -462,7 +462,8 @@ async def maybe_init_healthcheck_policy(self): raise ValueError("OPA health check policy not found!") try: - healthcheck_policy_code = open(healthcheck_policy_path, "r").read() + with open(healthcheck_policy_path, "r") as file: + healthcheck_policy_code = file.read() except IOError as err: logger.error( "Critical: Cannot read healthcheck policy: {err}", err=repr(err) diff --git a/packages/opal-common/opal_common/authentication/casting.py b/packages/opal-common/opal_common/authentication/casting.py index c742fc279..9713ed2d5 100644 --- a/packages/opal-common/opal_common/authentication/casting.py +++ b/packages/opal-common/opal_common/authentication/casting.py @@ -50,7 +50,8 @@ def cast_private_key( key_path = os.path.expanduser(value) if os.path.isfile(key_path): - raw_key = open(key_path, "rb").read() + with open(key_path, "rb") as file: + raw_key = file.read() else: raw_key = maybe_decode_multiline_key(value) @@ -84,7 +85,8 @@ def cast_public_key(value: str, key_format: EncryptionKeyFormat) -> Optional[Pub key_path = os.path.expanduser(value) if os.path.isfile(key_path): - raw_key = open(key_path, "rb").read() + with open(key_path, "rb") as file: + raw_key = file.read() elif key_format == EncryptionKeyFormat.ssh: # ssh key format is one line raw_key = to_bytes(value) else: From 97c96bd7ed11c1c229c62b1dd80ac2a7225ba48c Mon Sep 17 00:00:00 2001 From: Dan Yishai Date: Thu, 18 Apr 2024 13:39:49 +0300 Subject: [PATCH 4/5] Change python version to >=3.9 --- packages/opal-client/setup.py | 2 +- packages/opal-common/setup.py | 2 +- packages/opal-server/setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/opal-client/setup.py b/packages/opal-client/setup.py index 1149fdc1d..a376f27ad 100644 --- a/packages/opal-client/setup.py +++ b/packages/opal-client/setup.py @@ -70,7 +70,7 @@ def get_install_requires(): "Topic :: Internet :: WWW/HTTP :: HTTP Servers", "Topic :: Internet :: WWW/HTTP :: WSGI", ], - python_requires=">=3.7", + python_requires=">=3.9", install_requires=client_install_requires + about.get_install_requires(project_root), entry_points=""" [console_scripts] diff --git a/packages/opal-common/setup.py b/packages/opal-common/setup.py index 47817b8ad..ed6006465 100644 --- a/packages/opal-common/setup.py +++ b/packages/opal-common/setup.py @@ -70,6 +70,6 @@ def get_install_requires(): "Topic :: Internet :: WWW/HTTP :: HTTP Servers", "Topic :: Internet :: WWW/HTTP :: WSGI", ], - python_requires=">=3.7", + python_requires=">=3.9", install_requires=common_install_requires + about.get_install_requires(project_root), ) diff --git a/packages/opal-server/setup.py b/packages/opal-server/setup.py index a345312d3..443628780 100644 --- a/packages/opal-server/setup.py +++ b/packages/opal-server/setup.py @@ -73,7 +73,7 @@ def get_install_requires(): "Topic :: Internet :: WWW/HTTP :: HTTP Servers", "Topic :: Internet :: WWW/HTTP :: WSGI", ], - python_requires=">=3.7", + python_requires=">=3.9", install_requires=server_install_requires + about.get_install_requires(project_root), entry_points={ "console_scripts": ["opal-server = opal_server.cli:cli"], From 310fb940cf3559bc22f888ac1a545f996251ca70 Mon Sep 17 00:00:00 2001 From: Dan Yishai Date: Thu, 18 Apr 2024 18:08:15 +0300 Subject: [PATCH 5/5] Change python version to >=3.9 --- packages/opal-client/setup.py | 5 +++-- packages/opal-common/setup.py | 5 +++-- packages/opal-server/setup.py | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/packages/opal-client/setup.py b/packages/opal-client/setup.py index a376f27ad..61797a053 100644 --- a/packages/opal-client/setup.py +++ b/packages/opal-client/setup.py @@ -64,9 +64,10 @@ def get_install_requires(): "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Topic :: Internet :: WWW/HTTP :: HTTP Servers", "Topic :: Internet :: WWW/HTTP :: WSGI", ], diff --git a/packages/opal-common/setup.py b/packages/opal-common/setup.py index ed6006465..4f647893d 100644 --- a/packages/opal-common/setup.py +++ b/packages/opal-common/setup.py @@ -64,9 +64,10 @@ def get_install_requires(): "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Topic :: Internet :: WWW/HTTP :: HTTP Servers", "Topic :: Internet :: WWW/HTTP :: WSGI", ], diff --git a/packages/opal-server/setup.py b/packages/opal-server/setup.py index 443628780..5a048f3c1 100644 --- a/packages/opal-server/setup.py +++ b/packages/opal-server/setup.py @@ -67,9 +67,10 @@ def get_install_requires(): "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Topic :: Internet :: WWW/HTTP :: HTTP Servers", "Topic :: Internet :: WWW/HTTP :: WSGI", ],