Skip to content

Commit a8d7e35

Browse files
Fix "kraken.spot.OrderbookClient is not able to resubscribe to book feeds after connection lost" (#149)
1 parent 99f6092 commit a8d7e35

15 files changed

Lines changed: 147 additions & 32 deletions

.github/workflows/_codecov.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
FUTURES_SECRET_KEY: ${{ secrets.FUTURES_SECRET_KEY }}
6565
FUTURES_SANDBOX_KEY: ${{ secrets.FUTURES_SANDBOX_KEY }}
6666
FUTURES_SANDBOX_SECRET: ${{ secrets.FUTURES_SANDBOX_SECRET }}
67-
run: pytest -vv -s --cov --cov-report=xml:coverage.xml tests
67+
run: pytest -vv --cov --cov-report=xml:coverage.xml tests
6868

6969
- name: Upload coverage to Codecov
7070
uses: codecov/codecov-action@v3

.pre-commit-config.yaml

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ repos:
2828
hooks:
2929
- id: python-use-type-annotations
3030
- id: rst-backticks
31-
# - id: rst-inline-touching-normal
3231
- id: rst-directive-colons
3332
- id: text-unicode-replacement-char
3433
- repo: https://github.com/psf/black
@@ -40,7 +39,7 @@ repos:
4039
hooks:
4140
- id: isort
4241
args:
43-
- --profile=black # solves conflicts between black and isort
42+
- --profile=black
4443
- repo: https://github.com/pycqa/flake8
4544
rev: 6.1.0
4645
hooks:
@@ -60,7 +59,7 @@ repos:
6059
- --rcfile=pyproject.toml
6160
- -d=R0801 # ignore duplicate code
6261
- repo: https://github.com/astral-sh/ruff-pre-commit
63-
rev: v0.0.285
62+
rev: v0.0.286
6463
hooks:
6564
- id: ruff
6665
args:
@@ -75,21 +74,8 @@ repos:
7574
pass_filenames: false
7675
args:
7776
- --config-file=pyproject.toml
78-
# - --install-types # do not use within pre-commit
79-
# - --non-interactive # same here
8077
- kraken
8178
- repo: https://github.com/pre-commit/mirrors-prettier
8279
rev: v3.0.2
8380
hooks:
8481
- id: prettier
85-
ci:
86-
autofix_commit_msg: |
87-
[pre-commit.ci] auto fixes from pre-commit.com hooks
88-
89-
for more information, see https://pre-commit.ci
90-
autofix_prs: false
91-
autoupdate_branch: ""
92-
autoupdate_commit_msg: "[pre-commit.ci] pre-commit autoupdate"
93-
autoupdate_schedule: weekly
94-
skip: []
95-
submodules: false

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## [Unreleased](https://github.com/btschwertfeger/python-kraken-sdk/tree/HEAD)
4+
5+
[Full Changelog](https://github.com/btschwertfeger/python-kraken-sdk/compare/v1.6.1...HEAD)
6+
7+
Uncategorized merged pull requests:
8+
9+
- Bump Pre-Commit hook versions and adjust typing [\#146](https://github.com/btschwertfeger/python-kraken-sdk/pull/146) ([btschwertfeger](https://github.com/btschwertfeger))
10+
311
## [v1.6.1](https://github.com/btschwertfeger/python-kraken-sdk/tree/v1.6.1) (2023-08-07)
412

513
[Full Changelog](https://github.com/btschwertfeger/python-kraken-sdk/compare/v1.6.0...v1.6.1)

examples/futures_examples.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
datefmt="%Y/%m/%d %H:%M:%S",
1818
level=logging.INFO,
1919
)
20-
logging.getLogger().setLevel(logging.INFO)
2120
logging.getLogger("requests").setLevel(logging.WARNING)
2221
logging.getLogger("urllib3").setLevel(logging.WARNING)
2322

examples/futures_trading_bot_template.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
datefmt="%Y/%m/%d %H:%M:%S",
3131
level=logging.INFO,
3232
)
33-
logging.getLogger().setLevel(logging.INFO)
3433
logging.getLogger("requests").setLevel(logging.WARNING)
3534
logging.getLogger("urllib3").setLevel(logging.WARNING)
3635

examples/futures_ws_examples.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
datefmt="%Y/%m/%d %H:%M:%S",
2626
level=logging.INFO,
2727
)
28-
logging.getLogger().setLevel(logging.INFO)
2928
logging.getLogger("requests").setLevel(logging.WARNING)
3029
logging.getLogger("urllib3").setLevel(logging.WARNING)
3130

examples/spot_examples.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
datefmt="%Y/%m/%d %H:%M:%S",
1919
level=logging.INFO,
2020
)
21-
logging.getLogger().setLevel(logging.INFO)
2221
logging.getLogger("requests").setLevel(logging.WARNING)
2322
logging.getLogger("urllib3").setLevel(logging.WARNING)
2423

examples/spot_orderbook.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,19 @@
3535
from __future__ import annotations
3636

3737
import asyncio
38+
import logging
3839
from typing import Any, Dict, List, Tuple
3940

4041
from kraken.spot import OrderbookClient
4142

43+
logging.basicConfig(
44+
format="%(asctime)s %(module)s,line: %(lineno)d %(levelname)8s | %(message)s",
45+
datefmt="%Y/%m/%d %H:%M:%S",
46+
level=logging.INFO,
47+
)
48+
logging.getLogger().setLevel(logging.INFO)
49+
logging.getLogger("requests").setLevel(logging.WARNING)
50+
4251

4352
class Orderbook(OrderbookClient):
4453
"""

examples/spot_trading_bot_template_v1.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
datefmt="%Y/%m/%d %H:%M:%S",
3030
level=logging.INFO,
3131
)
32-
logging.getLogger().setLevel(logging.INFO)
3332
logging.getLogger("requests").setLevel(logging.WARNING)
3433
logging.getLogger("urllib3").setLevel(logging.WARNING)
3534

examples/spot_trading_bot_template_v2.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
datefmt="%Y/%m/%d %H:%M:%S",
3030
level=logging.INFO,
3131
)
32-
logging.getLogger().setLevel(logging.INFO)
3332
logging.getLogger("requests").setLevel(logging.WARNING)
3433
logging.getLogger("urllib3").setLevel(logging.WARNING)
3534

0 commit comments

Comments
 (0)