# HG changeset patch # User Vincent Hatakeyama <vincent.hatakeyama@xcg-consulting.fr> # Date 1740397482 -3600 # Mon Feb 24 12:44:42 2025 +0100 # Branch 18.0 # Node ID 4fb82a9fdbd2bb5929359d0ce1d642a4deba03b2 # Parent 1668ad04bb5a24067b3b979e61b779f4b6d72fe4 requests_unixsocket is now an optional dependency, only needed when connecting to redner on a unix socket diff --git a/NEWS.rst b/NEWS.rst --- a/NEWS.rst +++ b/NEWS.rst @@ -7,6 +7,8 @@ Declare compatibility with changes in converter 18.0.6.0.0. +requests_unixsocket is now an optional dependency, only needed when connecting to redner on a unix socket. + 18.0.1.5.0 ---------- diff --git a/__manifest__.py b/__manifest__.py --- a/__manifest__.py +++ b/__manifest__.py @@ -44,6 +44,5 @@ ], }, "installable": True, - "external_dependencies": {"python": ["requests_unixsocket"]}, "images": ["static/description/thumbnail.png"], } diff --git a/pyproject.toml b/pyproject.toml --- a/pyproject.toml +++ b/pyproject.toml @@ -16,13 +16,10 @@ "Framework :: Odoo :: 18.0", "License :: OSI Approved :: GNU Affero General Public License v3", ] -dependencies = [ - "odoo==18.0.*", - "requests_unixsocket", - "odoo-addon-converter >=18.0.4,<18.0.7", -] +dependencies = ["odoo==18.0.*", "odoo-addon-converter >=18.0.4,<18.0.7"] [project.optional-dependencies] +unixsocket = ["requests_unixsocket"] doc = ["sphinx"] test = [] diff --git a/redner.py b/redner.py --- a/redner.py +++ b/redner.py @@ -23,7 +23,6 @@ from urllib.parse import quote import requests -import requests_unixsocket # type: ignore[import-untyped] from odoo import _ # type: ignore[import-untyped] from odoo.exceptions import ValidationError # type: ignore[import-untyped] @@ -48,6 +47,9 @@ self.timeout = timeout if server_url.startswith("/"): + # import here as this is an optional requirement + import requests_unixsocket # type: ignore[import-untyped] + self.session = requests_unixsocket.Session() self.server_url = "http+unix://{}/".format(quote(server_url, safe="")) else: