ci/bin: Replace AIOHTTPTransport with RequestsHTTPTransport

For some reason AIOHTTPTransport started to use MultiDict after doing
some adjustments in the GraphQL query, which made `filecache` fail
because MultiDict object are not pickle-able.

Changing the transport strategy from AIOHTTPTransport to
RequestsHTTPTransport, which dropped one requirement. We aren't doing
async anyway, all the calls were sync before.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25940>
This commit is contained in:
Guilherme Gallo
2023-10-28 00:32:54 -03:00
committed by Marge Bot
parent 46b033a9bf
commit 609b4bfef8
2 changed files with 3 additions and 7 deletions

View File

@@ -14,7 +14,7 @@ from typing import Any, Iterable, Optional, Pattern, Union
import yaml
from filecache import DAY, filecache
from gql import Client, gql
from gql.transport.aiohttp import AIOHTTPTransport
from gql.transport.requests import RequestsHTTPTransport
from graphql import DocumentNode
Dag = dict[str, set[str]]
@@ -56,13 +56,10 @@ class GitlabGQL:
headers = {}
if self.token:
headers["Authorization"] = f"Bearer {self.token}"
self._transport = AIOHTTPTransport(
url=self.url, headers=headers, client_session_args = { "trust_env": True })
self._transport = RequestsHTTPTransport(url=self.url, headers=headers)
# Create a GraphQL client using the defined transport
self.client = Client(
transport=self._transport, fetch_schema_from_transport=True
)
self.client = Client(transport=self._transport, fetch_schema_from_transport=True)
@filecache(DAY)
def query(

View File

@@ -1,4 +1,3 @@
aiohttp==3.8.3
colorama==0.4.5
filecache==0.81
gql==3.4.0