Skip to content
Snippets Groups Projects
Commit 4fb82a9fdbd2 authored by Vincent Hatakeyama's avatar Vincent Hatakeyama
Browse files

requests_unixsocket is now an optional dependency, only needed when connecting...

requests_unixsocket is now an optional dependency, only needed when connecting to redner on a unix socket
parent 1668ad04bb5a
No related branches found
No related tags found
No related merge requests found
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
Declare compatibility with changes in converter 18.0.6.0.0. 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 18.0.1.5.0
---------- ----------
......
...@@ -44,6 +44,5 @@ ...@@ -44,6 +44,5 @@
], ],
}, },
"installable": True, "installable": True,
"external_dependencies": {"python": ["requests_unixsocket"]},
"images": ["static/description/thumbnail.png"], "images": ["static/description/thumbnail.png"],
} }
...@@ -16,10 +16,6 @@ ...@@ -16,10 +16,6 @@
"Framework :: Odoo :: 18.0", "Framework :: Odoo :: 18.0",
"License :: OSI Approved :: GNU Affero General Public License v3", "License :: OSI Approved :: GNU Affero General Public License v3",
] ]
dependencies = [ dependencies = ["odoo==18.0.*", "odoo-addon-converter >=18.0.4,<18.0.7"]
"odoo==18.0.*",
"requests_unixsocket",
"odoo-addon-converter >=18.0.4,<18.0.7",
]
[project.optional-dependencies] [project.optional-dependencies]
...@@ -24,5 +20,6 @@ ...@@ -24,5 +20,6 @@
[project.optional-dependencies] [project.optional-dependencies]
unixsocket = ["requests_unixsocket"]
doc = ["sphinx"] doc = ["sphinx"]
test = [] test = []
......
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
from urllib.parse import quote from urllib.parse import quote
import requests import requests
import requests_unixsocket # type: ignore[import-untyped]
from odoo import _ # type: ignore[import-untyped] from odoo import _ # type: ignore[import-untyped]
from odoo.exceptions import ValidationError # type: ignore[import-untyped] from odoo.exceptions import ValidationError # type: ignore[import-untyped]
...@@ -48,6 +47,9 @@ ...@@ -48,6 +47,9 @@
self.timeout = timeout self.timeout = timeout
if server_url.startswith("/"): 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.session = requests_unixsocket.Session()
self.server_url = "http+unix://{}/".format(quote(server_url, safe="")) self.server_url = "http+unix://{}/".format(quote(server_url, safe=""))
else: else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment