diff --git a/.circleci/config.yml b/.circleci/config.yml index a9afe55..20eb419 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,7 +8,7 @@ executors: parameters: v: type: string - default: "3.8" + default: "3.9" docker: - image: cimg/python:<< parameters.v >> @@ -101,7 +101,7 @@ jobs: deploy: executor: bitcart/docker-python docker: - - image: cimg/python:3.8 + - image: cimg/python:3.9 steps: - checkout @@ -135,7 +135,6 @@ workflows: matrix: parameters: v: - - "3.8" - "3.9" - "3.10" - "3.11" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bf665c6..5f3c9bc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,7 +23,7 @@ repos: rev: v3.15.1 hooks: - id: pyupgrade - args: ["--py38-plus"] + args: ["--py39-plus"] - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.5.0 hooks: diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 7daec9a..7ec98d2 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -3,7 +3,7 @@ version: 2 build: os: ubuntu-22.04 tools: - python: "3.8" + python: "3.9" sphinx: configuration: docs/conf.py diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b5dc6d..c2ce95e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Latest changes +## 1.15.0.0 + +We now support Python >= 3.9 only + ## 1.14.0.1 Don't install a separate tests package, but include tests in source tarball diff --git a/bitcart/coin.py b/bitcart/coin.py index 565493c..7a348ae 100644 --- a/bitcart/coin.py +++ b/bitcart/coin.py @@ -1,11 +1,11 @@ -from typing import Callable, Dict, Optional +from typing import Callable, Optional class Coin: coin_name: str xpub_name: str friendly_name: str - event_handlers: Dict[str, Callable] + event_handlers: dict[str, Callable] xpub: Optional[str] def __eq__(self, other: object) -> bool: diff --git a/bitcart/coins/btc.py b/bitcart/coins/btc.py index 9878be7..eb1cec2 100644 --- a/bitcart/coins/btc.py +++ b/bitcart/coins/btc.py @@ -1,6 +1,7 @@ import inspect +from collections.abc import Iterable from functools import wraps -from typing import TYPE_CHECKING, Any, Callable, Dict, Iterable, List, Optional, Union +from typing import TYPE_CHECKING, Any, Callable, Optional, Union from ..coin import Coin from ..errors import LightningDisabledError @@ -38,7 +39,7 @@ class BTC(Coin, EventDelivery): BALANCE_ATTRS = ["confirmed", "unconfirmed", "unmatured", "lightning"] EXPIRATION_KEY = "expiry" is_eth_based = False - additional_xpub_fields: List[str] = [] + additional_xpub_fields: list[str] = [] def __init__( self, @@ -55,7 +56,7 @@ def __init__( self.rpc_user = rpc_user or self.RPC_USER self.rpc_pass = rpc_pass or self.RPC_PASS self.xpub = xpub - self.event_handlers: Dict[str, Callable] = {} + self.event_handlers: dict[str, Callable] = {} self.amount_field = getattr(self, "AMOUNT_FIELD", f"amount_{self.coin_name}") self.server = RPCProxy(self.rpc_url, self.rpc_user, self.rpc_pass, self.xpub, session=session, proxy=proxy) diff --git a/bitcart/event_delivery.py b/bitcart/event_delivery.py index 87885b1..85eddbb 100644 --- a/bitcart/event_delivery.py +++ b/bitcart/event_delivery.py @@ -1,7 +1,8 @@ import asyncio import traceback +from collections.abc import Iterable from json import JSONDecodeError -from typing import TYPE_CHECKING, Callable, Dict, Iterable, Optional, Union +from typing import TYPE_CHECKING, Callable, Optional, Union from urllib.parse import urljoin from aiohttp import ClientConnectionError, WSMsgType @@ -18,7 +19,7 @@ class EventDelivery: server: "RPCProxy" - event_handlers: Dict[str, Callable] + event_handlers: dict[str, Callable] async def process_updates( self, updates: Iterable[dict], currency: Optional[str] = None, wallet: Optional[str] = None diff --git a/bitcart/manager.py b/bitcart/manager.py index 83bc99e..7ebb01f 100644 --- a/bitcart/manager.py +++ b/bitcart/manager.py @@ -1,6 +1,7 @@ import asyncio +from collections.abc import Iterable from functools import partial -from typing import TYPE_CHECKING, Any, Callable, Dict, Iterable, Optional +from typing import TYPE_CHECKING, Any, Callable, Optional from urllib.parse import urljoin from bitcart.errors import CurrencyUnsupportedError, NoCurrenciesRegisteredError @@ -18,7 +19,7 @@ class APIManager(EventDelivery): - def __init__(self, wallets: Dict[str, Iterable[str]] = {}, custom_params: Dict[str, dict] = {}): + def __init__(self, wallets: dict[str, Iterable[str]] = {}, custom_params: dict[str, dict] = {}): super().__init__() self.custom_params = custom_params self.wallets = ExtendedDefaultDict( diff --git a/bitcart/providers/jsonrpcrequests.py b/bitcart/providers/jsonrpcrequests.py index 4ef0fc7..0e25bfe 100644 --- a/bitcart/providers/jsonrpcrequests.py +++ b/bitcart/providers/jsonrpcrequests.py @@ -1,5 +1,5 @@ import asyncio -from typing import Any, Callable, Dict, Optional, Union +from typing import Any, Callable, Optional, Union from urllib.parse import urljoin import aiohttp @@ -44,7 +44,7 @@ def __init__( self._connector_init = dict(ssl=self.verify) self._spec = {"exceptions": {"-32600": {"exc_name": "UnauthorizedError", "docstring": "Unauthorized"}}} self._spec_valid = False - self._sessions: Dict[asyncio.AbstractEventLoop, aiohttp.ClientSession] = {} + self._sessions: dict[asyncio.AbstractEventLoop, aiohttp.ClientSession] = {} if session is not None: self._sessions[get_event_loop()] = session diff --git a/examples/atomic_tipbot/README.md b/examples/atomic_tipbot/README.md index 0bd6366..59ebbf7 100644 --- a/examples/atomic_tipbot/README.md +++ b/examples/atomic_tipbot/README.md @@ -6,7 +6,7 @@ The bot is available in telegram at @bitcart_atomic_tipbot Used tools: -- Python 3.8+ +- Python 3.9+ - Mongo DB - Pyrogram(for bot) - qrcode library for generating qr codes @@ -17,7 +17,7 @@ This bot is rewritten in my style, using modern python 3.6+ f-strings, and of co ## Installation -To get started, you will need to have [Python 3.8+](https://python.org) installed, of course. Using virtualenv is recommended. +To get started, you will need to have [Python 3.9+](https://python.org) installed, of course. Using virtualenv is recommended. Install Mongo DB using it's installation [guide](https://docs.mongodb.com/manual/administration/install-community) After that, install dependencies of this example using: @@ -72,7 +72,7 @@ If you will later need to stop them, run `./stop.sh` ### Manual way -As for this example, Python 3.8+ is required. Using virtualenv is recommended. +As for this example, Python 3.9+ is required. Using virtualenv is recommended. Clone Bitcart repository: diff --git a/setup.py b/setup.py index 97f9eeb..f486876 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ setup( name="bitcart", packages=find_packages(exclude=["tests", "tests.*"]), - version="1.14.0.1", + version="1.15.0.0", license="MIT", description="Bitcart coins support library", long_description=open("README.md").read(), @@ -21,11 +21,10 @@ "Topic :: Software Development :: Build Tools", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", ], - python_requires=">=3.8", + python_requires=">=3.9", )