Skip to content

Commit

Permalink
Update dependencies (#490)
Browse files Browse the repository at this point in the history
This PR aims to update dependencies and closes #489.

Main changes:
- Use latest version of safe-eth-py. This required some changes to
imports. The name of the Base network had to be changed. Also, the
output type of some function changed to `bytes` which required updating
the corresponding test, and some input changed trom a string to a
checksumed string.
- Use SQLAlchemy 2.0. This required some changes to executing statements
which change the database. instead of executing on the engine object,
the executions is called on the connection object. An additional `with`
block was required to close the connection. Alternatively, one could
have explicitly called a commit function.

I will probably bound from below some of the packages we use. I also
want to understand why web3 is still held back to 6.X instead of the
latest stable version 7.X.

I have tested the changes with the main payout in the accounting week
2024-12-31 to 2025-01-07. I tested that the base code does not crash at
the point where it did before. Actually posting a transaction has not
been done.
  • Loading branch information
fhenneke authored Jan 13, 2025
1 parent e383645 commit c27cf14
Show file tree
Hide file tree
Showing 14 changed files with 165 additions and 160 deletions.
33 changes: 16 additions & 17 deletions requirements.in
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
certifi>=2022.6.15
duneapi>=8.0.0
dune-client>=1.1.1
psycopg2-binary>=2.9.6
python-dotenv>=0.20.0
coinpaprika>=0.1.0
requests>=2.28.1
safe-eth-py>=5.5.0
slackclient>=2.9.4
web3<7.0.0
SQLAlchemy<2.0.0
sqlalchemy-stubs>=0.4
pandas==2.0.3
pandas-stubs==2.0.2.230605
numpy==1.26.4
pip-tools==7.4.1
python-dateutil>=2.9.0.post0
certifi
coinpaprika
duneapi
dune-client
psycopg2-binary
python-dotenv
requests
safe-eth-py
slackclient
web3
SQLAlchemy
sqlalchemy-stubs
pandas
numpy
python-dateutil
# dev dependencies
black
mypy
pylint
Expand Down
131 changes: 57 additions & 74 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,60 +4,56 @@
#
# pip-compile
#
aiohappyeyeballs==2.4.0
aiohappyeyeballs==2.4.4
# via aiohttp
aiohttp==3.10.5
aiohttp==3.11.11
# via
# dune-client
# slackclient
# web3
aiosignal==1.3.1
aiosignal==1.3.2
# via aiohttp
astroid==3.2.4
astroid==3.3.8
# via pylint
attrs==24.2.0
attrs==24.3.0
# via
# aiohttp
# jsonschema
# referencing
bitarray==2.9.2
bitarray==3.0.0
# via eth-account
black==24.8.0
black==24.10.0
# via -r requirements.in
build==1.2.1
# via pip-tools
cached-property==1.5.2
cached-property==2.0.1
# via
# py-ecc
# py-evm
certifi==2024.7.4
certifi==2024.12.14
# via
# -r requirements.in
# requests
charset-normalizer==3.3.2
charset-normalizer==3.4.1
# via requests
ckzg==1.0.2
# via
# eth-account
# py-evm
# web3
click==8.1.7
# via
# black
# pip-tools
click==8.1.8
# via black
coinpaprika==0.1.0
# via -r requirements.in
cytoolz==0.12.3
cytoolz==1.0.1
# via eth-utils
dataclasses-json==0.6.7
# via dune-client
deprecated==1.2.14
deprecated==1.2.15
# via
# dune-client
# duneapi
dill==0.3.8
dill==0.3.9
# via pylint
dune-client==1.7.5
dune-client==1.7.8
# via -r requirements.in
duneapi==8.0.0
# via -r requirements.in
Expand All @@ -67,7 +63,7 @@ eth-abi==5.1.0
# web3
eth-account==0.11.3
# via web3
eth-bloom==3.0.1
eth-bloom==3.1.0
# via py-evm
eth-hash[pycryptodome]==0.7.0
# via
Expand All @@ -77,7 +73,7 @@ eth-hash[pycryptodome]==0.7.0
# web3
eth-keyfile==0.8.1
# via eth-account
eth-keys==0.5.1
eth-keys==0.6.0
# via
# eth-account
# eth-keyfile
Expand All @@ -104,19 +100,19 @@ eth-utils==4.1.1
# rlp
# trie
# web3
frozenlist==1.4.1
frozenlist==1.5.0
# via
# aiohttp
# aiosignal
greenlet==3.0.3
greenlet==3.1.1
# via sqlalchemy
hexbytes==0.3.1
# via
# eth-account
# eth-rlp
# trie
# web3
idna==3.8
idna==3.10
# via
# requests
# yarl
Expand All @@ -126,21 +122,21 @@ isort==5.13.2
# via pylint
jsonschema==4.23.0
# via web3
jsonschema-specifications==2023.12.1
jsonschema-specifications==2024.10.1
# via jsonschema
lru-dict==1.2.0
# via
# py-evm
# web3
marshmallow==3.22.0
marshmallow==3.25.1
# via dataclasses-json
mccabe==0.7.0
# via pylint
multidict==6.0.5
multidict==6.1.0
# via
# aiohttp
# yarl
mypy==1.11.2
mypy==1.14.1
# via
# -r requirements.in
# sqlalchemy-stubs
Expand All @@ -151,53 +147,47 @@ mypy-extensions==1.0.0
# typing-inspect
ndjson==0.3.1
# via dune-client
numpy==1.26.4
numpy==2.2.1
# via
# -r requirements.in
# pandas
# pandas-stubs
packaging==24.1
packaging==24.2
# via
# black
# build
# marshmallow
# pytest
# safe-eth-py
pandas==2.0.3
# via -r requirements.in
pandas-stubs==2.0.2.230605
pandas==2.2.3
# via -r requirements.in
parsimonious==0.10.0
# via eth-abi
pathspec==0.12.1
# via black
pip-tools==7.4.1
# via -r requirements.in
platformdirs==4.2.2
platformdirs==4.3.6
# via
# black
# pylint
pluggy==1.5.0
# via pytest
protobuf==5.27.4
propcache==0.2.1
# via
# aiohttp
# yarl
protobuf==5.29.3
# via web3
psycopg2-binary==2.9.9
psycopg2-binary==2.9.10
# via -r requirements.in
py-ecc==7.0.1
# via py-evm
py-evm==0.10.1b1
# via safe-eth-py
pycryptodome==3.20.0
pycryptodome==3.21.0
# via
# eth-hash
# eth-keyfile
pylint==3.2.6
pylint==3.3.3
# via -r requirements.in
pyproject-hooks==1.1.0
# via
# build
# pip-tools
pytest==8.3.2
pytest==8.3.4
# via -r requirements.in
python-dateutil==2.9.0.post0
# via
Expand All @@ -208,15 +198,15 @@ python-dotenv==1.0.1
# via
# -r requirements.in
# duneapi
pytz==2024.1
pytz==2024.2
# via pandas
pyunormalize==15.1.0
pyunormalize==16.0.0
# via web3
referencing==0.35.1
# via
# jsonschema
# jsonschema-specifications
regex==2024.7.24
regex==2024.11.6
# via parsimonious
requests==2.32.3
# via
Expand All @@ -232,58 +222,57 @@ rlp==4.0.1
# eth-rlp
# py-evm
# trie
rpds-py==0.20.0
rpds-py==0.22.3
# via
# jsonschema
# referencing
safe-eth-py==5.8.0
safe-eth-py==6.2.0
# via -r requirements.in
safe-pysha3==1.0.4
# via safe-eth-py
six==1.16.0
six==1.17.0
# via python-dateutil
slackclient==2.9.4
# via -r requirements.in
sortedcontainers==2.4.0
# via trie
sqlalchemy==1.4.53
sqlalchemy==2.0.37
# via -r requirements.in
sqlalchemy-stubs==0.4
# via -r requirements.in
tomlkit==0.13.2
# via pylint
toolz==0.12.1
toolz==1.0.0
# via cytoolz
trie==3.0.1
# via py-evm
types-deprecated==1.2.9.20240311
types-deprecated==1.2.15.20241117
# via
# dune-client
# duneapi
types-python-dateutil==2.9.0.20240821
types-python-dateutil==2.9.0.20241206
# via dune-client
types-pytz==2024.1.0.20240417
# via pandas-stubs
types-pyyaml==6.0.12.20240808
types-pyyaml==6.0.12.20241230
# via dune-client
types-requests==2.32.0.20240712
types-requests==2.32.0.20241016
# via
# dune-client
# duneapi
types-setuptools==73.0.0.20240822
types-setuptools==75.8.0.20250110
# via dune-client
typing-extensions==4.12.2
# via
# eth-typing
# mypy
# sqlalchemy
# sqlalchemy-stubs
# typing-inspect
# web3
typing-inspect==0.9.0
# via dataclasses-json
tzdata==2024.1
tzdata==2024.2
# via pandas
urllib3==2.2.2
urllib3==2.3.0
# via
# requests
# types-requests
Expand All @@ -292,15 +281,9 @@ web3==6.20.3
# -r requirements.in
# duneapi
# safe-eth-py
websockets==13.0
websockets==14.1
# via web3
wheel==0.44.0
# via pip-tools
wrapt==1.16.0
wrapt==1.17.1
# via deprecated
yarl==1.9.4
yarl==1.18.3
# via aiohttp

# The following packages are considered to be unsafe in a requirements file:
# pip
# setuptools
4 changes: 2 additions & 2 deletions src/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from eth_typing.evm import ChecksumAddress
from dotenv import load_dotenv
from dune_client.types import Address
from gnosis.eth.ethereum_network import EthereumNetwork
from safe_eth.eth.ethereum_network import EthereumNetwork
from web3 import Web3

load_dotenv()
Expand Down Expand Up @@ -304,7 +304,7 @@ def from_network(network: Network) -> PaymentConfig:
min_cow_transfer = 10**18 # 1 COW

case Network.BASE:
payment_network = EthereumNetwork.BASE_MAINNET
payment_network = EthereumNetwork.BASE
short_name = "base"

cow_token_address = Address(
Expand Down
2 changes: 1 addition & 1 deletion src/data_sync/sync_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def __init__(self) -> None:
self.end_time = self.end_time.replace(tzinfo=datetime.timezone.utc)


async def sync_data_to_db( # pylint: disable=too-many-arguments
async def sync_data_to_db( # pylint: disable=too-many-arguments, too-many-positional-arguments
type_of_data: str,
node: Web3,
orderbook: OrderbookFetcher,
Expand Down
Loading

0 comments on commit c27cf14

Please sign in to comment.