Skip to content

Commit

Permalink
Version 1.15.0.0, python 3.9+
Browse files Browse the repository at this point in the history
  • Loading branch information
MrNaif2018 committed Mar 15, 2024
1 parent 070e67b commit 4ceac88
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 22 deletions.
5 changes: 2 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ executors:
parameters:
v:
type: string
default: "3.8"
default: "3.9"

docker:
- image: cimg/python:<< parameters.v >>
Expand Down Expand Up @@ -101,7 +101,7 @@ jobs:
deploy:
executor: bitcart/docker-python
docker:
- image: cimg/python:3.8
- image: cimg/python:3.9
steps:
- checkout

Expand Down Expand Up @@ -135,7 +135,6 @@ workflows:
matrix:
parameters:
v:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3.8"
python: "3.9"

sphinx:
configuration: docs/conf.py
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions bitcart/coin.py
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
7 changes: 4 additions & 3 deletions bitcart/coins/btc.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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,
Expand All @@ -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)

Expand Down
5 changes: 3 additions & 2 deletions bitcart/event_delivery.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
5 changes: 3 additions & 2 deletions bitcart/manager.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions bitcart/providers/jsonrpcrequests.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions examples/atomic_tipbot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:

Expand Down Expand Up @@ -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:

Expand Down
5 changes: 2 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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",
)

0 comments on commit 4ceac88

Please sign in to comment.