Skip to content

Commit

Permalink
Resolve "Mark kraken.spot.KrakenSpotWSClientV1 as deprecated" (#201)
Browse files Browse the repository at this point in the history
  • Loading branch information
btschwertfeger committed Mar 10, 2024
1 parent 8387327 commit f08992f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
4 changes: 2 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ include README.md LICENSE pyproject.toml

graft kraken

prune .cache
prune .github
prune doc
prune examples
prune tests
prune venv
prune .github
prune .cache
10 changes: 10 additions & 0 deletions kraken/spot/websocket_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

import asyncio
import json
import warnings
from copy import deepcopy
from typing import Any, Callable, Optional

Expand All @@ -24,6 +25,8 @@

class KrakenSpotWSClientV1(KrakenSpotWSClientBase):
"""
.. deprecated:: v2.2.0
Class to access public and private/authenticated websocket connections.
**This client only supports the Kraken Websocket API v1.**
Expand Down Expand Up @@ -164,6 +167,13 @@ def __init__(
no_public: bool = False,
beta: bool = False,
):
warnings.warn(
"The Kraken websocket API v1 is marked as deprecated and "
"its support could be removed in the future. "
"Please migrate to websocket API v2.",
category=DeprecationWarning,
stacklevel=2,
)
super().__init__(
key=key,
secret=secret,
Expand Down
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ junit_family = "xunit2"
testpaths = ["tests"]

[tool.pytest.ini_options]
filterwarnings = [
"ignore:The Kraken websocket API v1 is marked as deprecated*:DeprecationWarning",
]

cache_dir = ".cache/pytest"
markers = [
"wip: Used to run a specific test by hand.",
Expand All @@ -107,7 +111,6 @@ markers = [
"futures_funding: … Futures Funding endpoint.",
"futures_websocket: … Futures Websocket endpoint.",
]

[tool.coverage.run]
source = ["kraken"]
omit = ["*tests*"]
Expand All @@ -120,6 +123,7 @@ skip_empty = true
skip = "CHANGELOG.md,examples/market_client_example.ipynb"
check-filenames = true


# ========= T Y P I N G ========================================================
#
[tool.mypy]
Expand Down
4 changes: 1 addition & 3 deletions tests/spot/test_spot_orderbook_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@
@pytest.mark.spot_websocket()
@pytest.mark.spot_orderbook()
def test_create_public_bot(caplog: Any) -> None:
"""
Checks if the websocket client can be instantiated.
"""
"""Checks if the websocket client can be instantiated."""

async def create_bot() -> None:
orderbook: OrderbookClientV1Wrapper = OrderbookClientV1Wrapper()
Expand Down

0 comments on commit f08992f

Please sign in to comment.