Skip to content

Commit

Permalink
Set version 5.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Uxio0 committed Jun 22, 2023
1 parent ee065fb commit 8456fdd
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 6 deletions.
2 changes: 1 addition & 1 deletion gnosis/eth/clients/etherscan_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def _prepare_http_session(self) -> requests.Session:
"""
Prepare http session with custom pooling. See:
https://urllib3.readthedocs.io/en/stable/advanced-usage.html
https://2.python-requests.org/en/latest/api/#requests.adapters.HTTPAdapter
https://docs.python-requests.org/en/v1.2.3/api/#requests.adapters.HTTPAdapter
https://web3py.readthedocs.io/en/stable/providers.html#httpprovider
"""
session = requests.Session()
Expand Down
2 changes: 1 addition & 1 deletion gnosis/eth/clients/sourcify.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def _prepare_http_session(self) -> requests.Session:
"""
Prepare http session with custom pooling. See:
https://urllib3.readthedocs.io/en/stable/advanced-usage.html
https://2.python-requests.org/en/latest/api/#requests.adapters.HTTPAdapter
https://docs.python-requests.org/en/v1.2.3/api/#requests.adapters.HTTPAdapter
https://web3py.readthedocs.io/en/stable/providers.html#httpprovider
"""
session = requests.Session()
Expand Down
2 changes: 1 addition & 1 deletion gnosis/eth/ethereum_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1211,7 +1211,7 @@ def _prepare_http_session(self, retry_count: int) -> requests.Session:
"""
Prepare http session with custom pooling. See:
https://urllib3.readthedocs.io/en/stable/advanced-usage.html
https://2.python-requests.org/en/latest/api/#requests.adapters.HTTPAdapter
https://docs.python-requests.org/en/v1.2.3/api/#requests.adapters.HTTPAdapter
https://web3py.readthedocs.io/en/stable/providers.html#httpprovider
"""
session = requests.Session()
Expand Down
2 changes: 1 addition & 1 deletion gnosis/protocol/gnosis_protocol_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def _prepare_http_session(self) -> requests.Session:
"""
Prepare http session with custom pooling. See:
https://urllib3.readthedocs.io/en/stable/advanced-usage.html
https://2.python-requests.org/en/latest/api/#requests.adapters.HTTPAdapter
https://docs.python-requests.org/en/v1.2.3/api/#requests.adapters.HTTPAdapter
https://web3py.readthedocs.io/en/stable/providers.html#httpprovider
"""
session = requests.Session()
Expand Down
19 changes: 18 additions & 1 deletion gnosis/safe/api/base_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,26 @@ def __init__(
self.base_url = base_url or self.URL_BY_NETWORK.get(network)
if not self.base_url:
raise EthereumNetworkNotSupported(network)
self.http_session = requests.Session()
self.http_session = self._prepare_http_session()
self.request_timeout = request_timeout

def _prepare_http_session(self) -> requests.Session:
"""
Prepare http session with custom pooling. See:
https://urllib3.readthedocs.io/en/stable/advanced-usage.html
https://docs.python-requests.org/en/v1.2.3/api/#requests.adapters.HTTPAdapter
https://web3py.readthedocs.io/en/stable/providers.html#httpprovider
"""
session = requests.Session()
adapter = requests.adapters.HTTPAdapter(
pool_connections=10, # Doing all the connections to the same url
pool_maxsize=100, # Number of concurrent connections
pool_block=False,
)
session.mount("http://", adapter)
session.mount("https://", adapter)
return session

@classmethod
def from_ethereum_client(cls, ethereum_client: EthereumClient) -> "SafeBaseAPI":
ethereum_network = ethereum_client.get_network()
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = safe-eth-py
version = 5.4.3
version = 5.5.0
description = Safe Ecosystem Foundation utilities for Ethereum projects
long_description = file: README.rst
long_description_content_type = text/x-rst; charset=UTF-8
Expand Down

0 comments on commit 8456fdd

Please sign in to comment.