Skip to content

Commit 6ceec60

Browse files
committed
bump: version 0.1.4
1 parent 7109dfa commit 6ceec60

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+393
-366
lines changed

.github/workflows/publish.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,33 +26,33 @@ jobs:
2626
runs-on: ubuntu-latest
2727
steps:
2828
- uses: actions/checkout@v3
29-
29+
3030
- name: Set up Python
3131
uses: actions/setup-python@v4
3232
with:
3333
python-version: '3.9'
34-
34+
3535
- name: Install build dependencies
3636
run: |
3737
python -m pip install --upgrade pip
3838
pip install build twine
39-
39+
4040
- name: Build package
4141
run: python -m build
42-
42+
4343
- name: Check distribution
4444
run: twine check dist/*
45-
45+
4646
- name: Publish to Test PyPI
4747
env:
4848
TWINE_USERNAME: __token__
4949
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }}
5050
TWINE_REPOSITORY_URL: https://test.pypi.org/legacy/
5151
run: twine upload --skip-existing dist/*
52-
52+
5353
- name: Publish to PyPI
5454
if: github.event_name == 'release' && github.event.release.prerelease == false
5555
env:
5656
TWINE_USERNAME: __token__
5757
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
58-
run: twine upload dist/*
58+
run: twine upload dist/*

.github/workflows/test.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@ jobs:
1515

1616
steps:
1717
- uses: actions/checkout@v3
18-
18+
1919
- name: Set up Python ${{ matrix.python-version }}
2020
uses: actions/setup-python@v4
2121
with:
2222
python-version: ${{ matrix.python-version }}
23-
23+
2424
- name: Install dependencies
2525
run: |
2626
python -m pip install --upgrade pip
2727
pip install -r requirements-dev.txt
28-
28+
2929
- name: Run tests
3030
run: pytest --cov=aiowhitebit
31-
31+
3232
- name: Run black
33-
run: black --check .
33+
run: black --check .

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
.idea
44
__pycache__/
55
*.py[cod]
6-
*$py.class
6+
*$py.class

.pre-commit-config.yaml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
1+
exclude: ^examples/
12
repos:
23
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.4.0
4+
rev: v5.0.0
45
hooks:
56
- id: trailing-whitespace
67
- id: end-of-file-fixer
78
- id: check-yaml
9+
- id: check-toml
810
- id: check-added-large-files
11+
- id: debug-statements
12+
- id: requirements-txt-fixer
913

10-
- repo: https://github.com/psf/black
11-
rev: 23.3.0
14+
- repo: https://github.com/astral-sh/ruff-pre-commit
15+
rev: v0.11.5
1216
hooks:
13-
- id: black
14-
args: [--line-length=120]
17+
- id: ruff
18+
args: [--fix, --exit-non-zero-on-fix]
19+
- id: ruff-format
20+
21+
- repo: https://github.com/RobertCraigie/pyright-python
22+
rev: v1.1.399
23+
hooks:
24+
- id: pyright

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# Changelog
22

3-
## [0.1.1] - 2024-03-14
3+
## [0.1.4] - 2024-03-XX
4+
5+
### Added
6+
- Support for Pydantic v2 while maintaining compatibility with v1.10.21
7+
- Fixed MaintenanceStatus model to handle both string and integer status values
8+
9+
## [0.1.3] - 2024-03-14
410

511
### Added
612
- Initial release

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1818
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
21+
SOFTWARE.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ from aiowhitebit.clients.public import PublicV4Client
2929

3030
async def main():
3131
client = PublicV4Client()
32-
32+
3333
# Get market info
3434
markets = await client.get_market_info()
3535
print(f"Number of markets: {len(markets)}")
36-
36+
3737
# Get market activity
3838
activity = await client.get_market_activity()
3939
print(f"BTC_USDT last price: {activity.get('BTC_USDT').last_price}")

aiowhitebit/clients/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
"""Clients for the WhiteBit API."""
22

3-
from aiowhitebit.clients.public import PublicV1Client, PublicV2Client, PublicV4Client
43
from aiowhitebit.clients.private import PrivateV4Client
4+
from aiowhitebit.clients.public import PublicV1Client, PublicV2Client, PublicV4Client
5+
from aiowhitebit.clients.webhook import WebhookDataLoader, get_webhook_data_loader
56
from aiowhitebit.clients.websocket import (
67
PublicWebSocketClient,
7-
get_public_websocket_client,
88
SubscribeRequest,
9+
get_public_websocket_client,
910
ws_subscribe_builder,
1011
)
11-
from aiowhitebit.clients.webhook import WebhookDataLoader, get_webhook_data_loader

aiowhitebit/clients/base.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
"""Base client functionality for the WhiteBit API."""
2+
23
from asyncio import Semaphore
3-
from typing import Any, Optional, TypeVar, Callable
4+
from typing import Any, Callable, Optional, TypeVar
45

56
import aiohttp
67

78
from aiowhitebit.constants import BASE_URL
89
from aiowhitebit.exceptions import WhitebitAPIError
910

10-
T = TypeVar('T')
11+
T = TypeVar("T")
1112

1213

1314
class HTTPClient:
@@ -50,13 +51,7 @@ def __init__(self, base_url: str = BASE_URL):
5051
def request_url(self, path: str) -> str:
5152
return f"{self.base_url}{path}"
5253

53-
async def _make_request(
54-
self,
55-
path: str,
56-
converter: Optional[Callable[[dict], T]] = None
57-
) -> T:
54+
async def _make_request(self, path: str, converter: Optional[Callable[[dict], T]] = None) -> T:
5855
full_url = self.request_url(path)
5956
json_obj = await self.get(full_url)
6057
return converter(json_obj) if converter else json_obj
61-
62-

aiowhitebit/clients/private/v4.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,39 +5,39 @@
55
import hmac
66
import json
77
import time
8-
from typing import Optional, Union, List, Callable
8+
from typing import Callable, List, Optional, Union
99

1010
import aiohttp
1111
from pydantic import BaseModel
1212

13-
from aiowhitebit.constants import BASE_URL, API_KEY, SECRET_KEY
13+
from aiowhitebit.constants import API_KEY, BASE_URL, SECRET_KEY
1414
from aiowhitebit.converters.private import (
15+
convert_active_orders_to_dto,
16+
convert_cancel_order_to_dto,
1517
convert_executed_deals_to_dto,
1618
convert_executed_orders_by_market_to_dto,
1719
convert_executed_orders_to_dto,
18-
convert_active_orders_to_dto,
19-
convert_cancel_order_to_dto,
20-
convert_order_response_to_dto,
2120
convert_get_trading_balance_to_dto,
21+
convert_order_response_to_dto,
2222
)
2323
from aiowhitebit.exceptions import handle_errors
2424
from aiowhitebit.models.private import (
25-
TradingBalanceItem,
26-
TradingBalanceList,
25+
ActiveOrdersRequest,
26+
CancelOrderRequest,
27+
CancelOrderResponse,
2728
CreateLimitOrderRequest,
2829
CreateOrderResponse,
2930
CreateStockMarketOrderRequest,
3031
CreateStopLimitOrderRequest,
3132
CreateStopMarketOrderRequest,
32-
CancelOrderRequest,
33-
CancelOrderResponse,
34-
ActiveOrdersRequest,
35-
ExecutedOrderHistoryRequest,
36-
ExecutedOrdersResponse,
37-
ExecutedOrderDealsRequest,
3833
ExecutedDealsResponse,
34+
ExecutedOrderDealsRequest,
35+
ExecutedOrderHistoryRequest,
3936
ExecutedOrdersByMarket,
4037
ExecutedOrdersByMarketResponse,
38+
ExecutedOrdersResponse,
39+
TradingBalanceItem,
40+
TradingBalanceList,
4141
)
4242

4343

0 commit comments

Comments
 (0)