diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 9b40dce..9adcc18 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.11"] + python-version: ["3.12"] steps: - uses: actions/checkout@v4 @@ -30,7 +30,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.11"] + python-version: ["3.12"] steps: - name: Setup and run ganache run: | diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4a96652..4dd0d56 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,19 +2,19 @@ # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/PyCQA/isort - rev: 5.12.0 + rev: 5.13.2 hooks: - id: isort - repo: https://github.com/psf/black - rev: 23.11.0 + rev: 24.10.0 hooks: - id: black - repo: https://github.com/PyCQA/flake8 - rev: 6.1.0 + rev: 7.1.1 hooks: - id: flake8 - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v5.0.0 hooks: - id: check-docstring-first - id: check-merge-conflict diff --git a/README.md b/README.md index 148d95f..0f29749 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ [![Python CI](https://github.com/safe-global/safe-price-service/actions/workflows/python.yml/badge.svg?branch=main)](https://github.com/safe-global/safe-price-service/actions/workflows/python.yml) [![Coverage Status](https://coveralls.io/repos/github/safe-global/safe-price-service/badge.svg?branch=main)](https://coveralls.io/github/safe-global/safe-price-service?branch=main) [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit) -![Python 3.11](https://img.shields.io/badge/Python-3.11-blue.svg) +![Python 3.12](https://img.shields.io/badge/Python-3.12-blue.svg) ![Django 5](https://img.shields.io/badge/Django-5-blue.svg) [![Docker Image Version (latest semver)](https://img.shields.io/docker/v/safeglobal/safe-price-service?label=Docker&sort=semver)](https://hub.docker.com/r/safeglobal/safe-price-service) diff --git a/config/gunicorn.py b/config/gunicorn.py index 247ed43..8356295 100644 --- a/config/gunicorn.py +++ b/config/gunicorn.py @@ -1,6 +1,7 @@ """ Store gunicorn variables in this file, so they can be read by Django """ + import os gunicorn_request_timeout = os.environ.get("WEB_WORKER_TIMEOUT", 60) diff --git a/config/wsgi.py b/config/wsgi.py index 8ea7f01..ee32246 100644 --- a/config/wsgi.py +++ b/config/wsgi.py @@ -13,6 +13,7 @@ framework. """ + import os import sys diff --git a/docker/web/Dockerfile b/docker/web/Dockerfile index bb10c49..1144405 100644 --- a/docker/web/Dockerfile +++ b/docker/web/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.11-slim +FROM python:3.12-slim ARG APP_HOME=/app WORKDIR ${APP_HOME} diff --git a/requirements-test.txt b/requirements-test.txt index ec66252..34831a3 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,12 +1,12 @@ -r requirements.txt -coverage==7.4.3 -django-stubs==5.0.2 +coverage==7.6.10 +django-stubs==5.1.2 django-test-migrations==1.4.0 -factory-boy==3.3.0 -faker==30.6.0 -mypy==1.11.2 -pytest==8.3.1 +factory-boy==3.3.1 +faker==33.3.1 +mypy==1.14.1 +pytest==8.3.4 pytest-django==4.9.0 pytest-env==1.1.5 -pytest-rerunfailures==14.0 +pytest-rerunfailures==15.0 pytest-sugar==1.0.0 diff --git a/requirements.txt b/requirements.txt index 55dabdd..f9e89cb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,17 +1,17 @@ -cachetools==5.4.0 -django==5.1.1 -django-cors-headers==4.4.0 +cachetools==5.5.0 +django==5.1.5 +django-cors-headers==4.6.0 django-debug-toolbar django-debug-toolbar-force -django-environ==0.11.2 +django-environ==0.12.0 django-extensions==3.2.3 -djangorestframework==3.15.1 +djangorestframework==3.15.2 djangorestframework-camel-case==1.4.2 docutils==0.21.2 -drf-yasg[validation]==1.21.7 +drf-yasg[validation]==1.21.8 gunicorn[gevent]==23.0.0 hexbytes==0.3.1 -packaging>=21 -requests==2.31.0 -safe-eth-py[django]==6.0.0b34 +packaging>=24.2 +requests==2.32.3 +safe-eth-py[django]==6.3.0 web3==6.20.3 diff --git a/safe_price_service/tokens/clients/coingecko_client.py b/safe_price_service/tokens/clients/coingecko_client.py index a33fe28..b2cde3c 100644 --- a/safe_price_service/tokens/clients/coingecko_client.py +++ b/safe_price_service/tokens/clients/coingecko_client.py @@ -5,7 +5,7 @@ from eth_typing import ChecksumAddress -from gnosis.eth import EthereumNetwork +from safe_eth.eth import EthereumNetwork from safe_price_service.tokens.clients.base_client import BaseHTTPClient from safe_price_service.tokens.clients.exceptions import ( diff --git a/safe_price_service/tokens/clients/kleros_client.py b/safe_price_service/tokens/clients/kleros_client.py index b1be366..61aa33c 100644 --- a/safe_price_service/tokens/clients/kleros_client.py +++ b/safe_price_service/tokens/clients/kleros_client.py @@ -3,8 +3,8 @@ from hexbytes import HexBytes -from gnosis.eth import EthereumClient -from gnosis.eth.constants import NULL_ADDRESS +from safe_eth.eth import EthereumClient +from safe_eth.eth.constants import NULL_ADDRESS from .kleros_abi import kleros_abi diff --git a/safe_price_service/tokens/clients/zerion_client.py b/safe_price_service/tokens/clients/zerion_client.py index 32c6c19..521c044 100644 --- a/safe_price_service/tokens/clients/zerion_client.py +++ b/safe_price_service/tokens/clients/zerion_client.py @@ -4,8 +4,8 @@ from eth_typing import ChecksumAddress from web3.exceptions import ContractLogicError -from gnosis.eth import EthereumClient -from gnosis.eth.constants import NULL_ADDRESS +from safe_eth.eth import EthereumClient +from safe_eth.eth.constants import NULL_ADDRESS @dataclass diff --git a/safe_price_service/tokens/services/price_service.py b/safe_price_service/tokens/services/price_service.py index 79ac72b..4595414 100644 --- a/safe_price_service/tokens/services/price_service.py +++ b/safe_price_service/tokens/services/price_service.py @@ -13,10 +13,10 @@ from eth.constants import ZERO_ADDRESS from eth_typing import ChecksumAddress -from gnosis.eth import EthereumClient -from gnosis.eth.constants import NULL_ADDRESS -from gnosis.eth.ethereum_client import EthereumNetwork -from gnosis.eth.oracles import ( +from safe_eth.eth import EthereumClient +from safe_eth.eth.constants import NULL_ADDRESS +from safe_eth.eth.ethereum_client import EthereumNetwork +from safe_eth.eth.oracles import ( AaveOracle, BalancerOracle, ComposedPriceOracle, diff --git a/safe_price_service/tokens/tests/clients/test_clients.py b/safe_price_service/tokens/tests/clients/test_clients.py index d83b348..f758540 100644 --- a/safe_price_service/tokens/tests/clients/test_clients.py +++ b/safe_price_service/tokens/tests/clients/test_clients.py @@ -4,7 +4,7 @@ from requests import Session -from gnosis.eth.tests.utils import just_test_if_mainnet_node +from safe_eth.eth.tests.utils import just_test_if_mainnet_node from ...clients import CannotGetPrice, CoingeckoClient, KrakenClient, KucoinClient diff --git a/safe_price_service/tokens/tests/clients/test_coingecko_client.py b/safe_price_service/tokens/tests/clients/test_coingecko_client.py index cefd0c5..5b18d12 100644 --- a/safe_price_service/tokens/tests/clients/test_coingecko_client.py +++ b/safe_price_service/tokens/tests/clients/test_coingecko_client.py @@ -4,7 +4,7 @@ import pytest -from gnosis.eth import EthereumNetwork +from safe_eth.eth import EthereumNetwork from ...clients import CannotGetPrice from ...clients.coingecko_client import CoingeckoClient diff --git a/safe_price_service/tokens/tests/clients/test_kleros_client.py b/safe_price_service/tokens/tests/clients/test_kleros_client.py index e7b9af8..a3711e1 100644 --- a/safe_price_service/tokens/tests/clients/test_kleros_client.py +++ b/safe_price_service/tokens/tests/clients/test_kleros_client.py @@ -1,8 +1,8 @@ from django.test import TestCase -from gnosis.eth import EthereumClient -from gnosis.eth.tests.utils import just_test_if_mainnet_node -from gnosis.eth.utils import fast_is_checksum_address +from safe_eth.eth import EthereumClient +from safe_eth.eth.tests.utils import just_test_if_mainnet_node +from safe_eth.eth.utils import fast_is_checksum_address from ...clients.kleros_client import KlerosClient diff --git a/safe_price_service/tokens/tests/clients/test_zerion_client.py b/safe_price_service/tokens/tests/clients/test_zerion_client.py index 7633bcf..b8d8151 100644 --- a/safe_price_service/tokens/tests/clients/test_zerion_client.py +++ b/safe_price_service/tokens/tests/clients/test_zerion_client.py @@ -2,8 +2,8 @@ from eth_account import Account -from gnosis.eth import EthereumClient -from gnosis.eth.tests.utils import just_test_if_mainnet_node +from safe_eth.eth import EthereumClient +from safe_eth.eth.tests.utils import just_test_if_mainnet_node from ...clients.zerion_client import ( UniswapComponent, diff --git a/safe_price_service/tokens/tests/test_price_service.py b/safe_price_service/tokens/tests/test_price_service.py index d94525d..acaa816 100644 --- a/safe_price_service/tokens/tests/test_price_service.py +++ b/safe_price_service/tokens/tests/test_price_service.py @@ -8,9 +8,9 @@ from eth.constants import ZERO_ADDRESS from eth_account import Account -from gnosis.eth import EthereumClient, EthereumNetwork -from gnosis.eth.oracles import KyberOracle, OracleException, UnderlyingToken -from gnosis.eth.tests.utils import just_test_if_mainnet_node +from safe_eth.eth import EthereumClient, EthereumNetwork +from safe_eth.eth.oracles import KyberOracle, OracleException, UnderlyingToken +from safe_eth.eth.tests.utils import just_test_if_mainnet_node from ..clients import CannotGetPrice, CoingeckoClient, KrakenClient, KucoinClient from ..services.price_service import ( diff --git a/safe_price_service/tokens/views.py b/safe_price_service/tokens/views.py index be71057..b95aa71 100644 --- a/safe_price_service/tokens/views.py +++ b/safe_price_service/tokens/views.py @@ -6,7 +6,7 @@ from rest_framework.generics import GenericAPIView from rest_framework.response import Response -from gnosis.eth.utils import fast_is_checksum_address +from safe_eth.eth.utils import fast_is_checksum_address from safe_price_service import __version__ diff --git a/setup.cfg b/setup.cfg index fa4b7c6..6d501b0 100644 --- a/setup.cfg +++ b/setup.cfg @@ -12,9 +12,9 @@ exclude = .tox,.git,*/static/CACHE/*,docs,node_modules,venv profile = black default_section = THIRDPARTY known_first_party = safe_price_service -known_gnosis = py_eth_sig_utils,gnosis +known_safe = py_eth_sig_utils,safe_eth known_django = django -sections = FUTURE,STDLIB,DJANGO,THIRDPARTY,GNOSIS,FIRSTPARTY,LOCALFOLDER +sections = FUTURE,STDLIB,DJANGO,THIRDPARTY,SAFE,FIRSTPARTY,LOCALFOLDER [tool:pytest] env = @@ -22,7 +22,7 @@ env = DJANGO_DOT_ENV_FILE=.env.test [mypy] -python_version = 3.11 +python_version = 3.12 check_untyped_defs = True ignore_missing_imports = True warn_unused_ignores = True