From 6d9ac18deef66bd86b4a124f6dc5f0cf48b8b7e3 Mon Sep 17 00:00:00 2001 From: TouwaStar Date: Mon, 18 Sep 2023 15:36:37 +0200 Subject: [PATCH 1/2] Make the package compatible with zeep 4.2.1 --- netsuite/soap_api/client.py | 4 ---- pyproject.toml | 2 +- tests/test_soap_api.py | 4 ++++ 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/netsuite/soap_api/client.py b/netsuite/soap_api/client.py index 97db3f7..6dfda17 100644 --- a/netsuite/soap_api/client.py +++ b/netsuite/soap_api/client.py @@ -97,13 +97,9 @@ def _generate_wsdl_url(self) -> str: def _generate_cache(self) -> zeep.cache.Base: return zeep.cache.SqliteCache(timeout=60 * 60 * 24 * 365) - def _generate_session(self) -> zeep.requests.Session: - return zeep.requests.Session() - def _generate_transport(self) -> zeep.transports.AsyncTransport: return AsyncNetSuiteTransport( self.wsdl_url, - session=self._generate_session(), cache=self.cache, ) diff --git a/pyproject.toml b/pyproject.toml index 12b665c..f7819b4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,7 @@ httpx = "~0.23" pydantic = "~1" orjson = {version = "~3", optional = true} ipython = {version = "~8", optional = true, python = "^3.8"} -zeep = {version = "~4", optional = true, extras = ["async"]} +zeep = {version = "4.2.1", optional = true, extras = ["async"]} oauthlib = "~3" [tool.poetry.extras] diff --git a/tests/test_soap_api.py b/tests/test_soap_api.py index 710aed1..6bbc2ac 100644 --- a/tests/test_soap_api.py +++ b/tests/test_soap_api.py @@ -17,3 +17,7 @@ def test_netsuite_wsdl_url(dummy_config): soap_api.wsdl_url == "https://123456-sb1.suitetalk.api.netsuite.com/wsdl/v2021_1_0/netsuite.wsdl" ) + +def test_netsuite_transport_initialization(dummy_config): + soap_api = NetSuiteSoapApi(dummy_config) + soap_api._generate_transport() From 5aff751b30300ef08475d9302f417ce19234dcae Mon Sep 17 00:00:00 2001 From: TouwaStar Date: Tue, 19 Sep 2023 09:11:12 +0200 Subject: [PATCH 2/2] Accept 4.2.1 or higher --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index f7819b4..2f902c3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,7 @@ httpx = "~0.23" pydantic = "~1" orjson = {version = "~3", optional = true} ipython = {version = "~8", optional = true, python = "^3.8"} -zeep = {version = "4.2.1", optional = true, extras = ["async"]} +zeep = {version = "^4.2.1", optional = true, extras = ["async"]} oauthlib = "~3" [tool.poetry.extras]