Skip to content

Commit

Permalink
Update python to 3.12 (#389)
Browse files Browse the repository at this point in the history
There seem to be issues with old versions of dependencies due to using
python 3.11. This PR updates to python 3.12.
  • Loading branch information
fhenneke authored Aug 21, 2024
1 parent dafa2db commit b7e74ae
Show file tree
Hide file tree
Showing 27 changed files with 42 additions and 17 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/postgres.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ jobs:
- ${{ github.workspace }}:/repo
steps:
- uses: actions/checkout@v3
- name: Setup Python 3.11
- name: Setup Python 3.12
uses: actions/setup-python@v3
with:
python-version: '3.11'
python-version: '3.12'
- name: Install Requirements
run: pip install -r requirements.txt
- name: Tests
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Python 3.11
- name: Setup Python 3.12
uses: actions/setup-python@v3
with:
python-version: '3.11'
python-version: '3.12'
- name: Install Requirements
run:
pip install -r requirements.txt
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.11
FROM python:3.12
COPY . .
RUN pip install -r requirements.txt
ENTRYPOINT [ "python3", "-m"]
ENTRYPOINT [ "python", "-m"]
2 changes: 1 addition & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[mypy]
python_version = 3.11
python_version = 3.12
ignore_missing_imports = True

[mypy-src.*]
Expand Down
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
black==23.3.0
certifi==2022.6.15
duneapi==8.0.0
dune-client==1.1.1
mypy<1.0.0
psycopg2-binary>=2.9.6
pylint==2.17.4
pytest==7.4.0
python-dotenv>=0.20.0
coinpaprika>=0.1.0
requests>=2.28.1
Expand All @@ -18,3 +14,7 @@ sqlalchemy-stubs==0.4
pandas==2.0.3
pandas-stubs==2.0.2.230605
numpy==1.26.4
black
mypy
pylint
pytest
1 change: 1 addition & 0 deletions src/abis/load.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Basic Contract ABI loader (from json files)"""

import json
import os
from enum import Enum
Expand Down
1 change: 1 addition & 0 deletions src/constants.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Project Global Constants. """

import os
from pathlib import Path

Expand Down
1 change: 1 addition & 0 deletions src/fetch/dune.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""All Dune related query fetching is defined here in the DuneFetcherClass"""

from typing import Optional

from dune_client.client import DuneClient
Expand Down
16 changes: 10 additions & 6 deletions src/fetch/payouts.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,11 @@ def as_payouts(self) -> list[Transfer]:
result.append(
Transfer(
token=None,
recipient=self.reward_target
if self.bonding_pool == COW_BONDING_POOL
else self.solver,
recipient=(
self.reward_target
if self.bonding_pool == COW_BONDING_POOL
else self.solver
),
amount_wei=reimbursement_eth + total_eth_reward,
)
)
Expand Down Expand Up @@ -227,9 +229,11 @@ def as_payouts(self) -> list[Transfer]:
result.append(
Transfer(
token=None,
recipient=self.reward_target
if self.bonding_pool == COW_BONDING_POOL
else self.solver,
recipient=(
self.reward_target
if self.bonding_pool == COW_BONDING_POOL
else self.solver
),
amount_wei=reimbursement_eth,
)
)
Expand Down
1 change: 1 addition & 0 deletions src/fetch/prices.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
An interface for fetching prices.
Currently, only price feed is CoinPaprika's Free tier API.
"""

import functools
import logging.config
from datetime import datetime
Expand Down
1 change: 1 addition & 0 deletions src/fetch/token_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Standalone script for fetching the trusted token
list and pushing the data to a dune user generated view.
"""

from __future__ import annotations

import json
Expand Down
1 change: 1 addition & 0 deletions src/fetch/transfer_file.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Script to generate the CSV Airdrop file for Solver Rewards over an Accounting Period
"""

from __future__ import annotations

import os
Expand Down
1 change: 1 addition & 0 deletions src/logger.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Easy universal log configuration """

import logging.config
from logging import Logger

Expand Down
1 change: 1 addition & 0 deletions src/models/accounting_period.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Common location for shared resources throughout the project.
"""

from __future__ import annotations

import urllib.parse
Expand Down
1 change: 1 addition & 0 deletions src/models/overdraft.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Overdraft Class"""

from __future__ import annotations

from dataclasses import dataclass
Expand Down
1 change: 1 addition & 0 deletions src/models/token.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Common location for shared resources throughout the project.
"""

from __future__ import annotations

from enum import Enum
Expand Down
1 change: 1 addition & 0 deletions src/models/transfer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Script to generate the CSV Airdrop file for Solver Rewards over an Accounting Period
"""

from __future__ import annotations

from dataclasses import dataclass
Expand Down
1 change: 1 addition & 0 deletions src/multisend.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
All the tools necessary to compose and encode a
Safe Multisend transaction consisting of Transfers
"""

import logging.config

from eth_typing.evm import ChecksumAddress
Expand Down
1 change: 1 addition & 0 deletions src/pg_client.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Basic client for connecting to postgres database with login credentials"""

from __future__ import annotations


Expand Down
1 change: 1 addition & 0 deletions src/queries.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Localized account of all Queries related to this project's main functionality
"""

from __future__ import annotations

from copy import copy
Expand Down
1 change: 1 addition & 0 deletions src/scripts/gap_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Gap detection script for finding missing transaction hashes of settlements.
Uses a form of binary search to minimize/reduce API requests.
"""

from __future__ import annotations
import argparse
import os
Expand Down
1 change: 1 addition & 0 deletions src/slack_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Basic Slack Post functionality. Sends a message thread to a specified channel.
"""

from slack.web.client import WebClient
from slack.web.slack_response import SlackResponse

Expand Down
1 change: 1 addition & 0 deletions src/utils/dataset.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Generic tools for manipulating datasets"""

from dataclasses import fields, is_dataclass
from typing import Any

Expand Down
1 change: 1 addition & 0 deletions src/utils/print_store.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Simple wrapper for print statements that saves all the messages chronologically in a list
"""

from collections import defaultdict
from enum import Enum

Expand Down
1 change: 1 addition & 0 deletions src/utils/query_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
It causes problems when people are not necessarily running the scripts from the project root
These utilities eliminate the need to use relative paths.
"""

import os

from src.constants import QUERY_PATH, DASHBOARD_PATH
Expand Down
1 change: 1 addition & 0 deletions src/utils/script_args.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Common method for initializing setup for scripts"""

import argparse
import os
from datetime import date, timedelta
Expand Down
1 change: 1 addition & 0 deletions src/utils/token_details.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Very basic Token Info Fetcher that gets token decimals
"""

import functools
import logging.config

Expand Down

0 comments on commit b7e74ae

Please sign in to comment.