Skip to content

Commit 2e0d1e7

Browse files
committed
fix: add missing dependencies and skip tests for optional deps
1 parent 6076b6d commit 2e0d1e7

19 files changed

Lines changed: 50 additions & 2 deletions

pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ dependencies = [
2525
"python-rapidjson>=1.10",
2626
"httpx>=0.27.0",
2727
"pyzmq>=26.0.0",
28+
"pydantic>=2.0.0",
29+
"websockets>=12.0",
2830
]
2931
classifiers = [
3032
"Programming Language :: Python :: 3",
@@ -651,6 +653,10 @@ dev = [
651653
"mypy>=1.0",
652654
"pre-commit>=3.0.0",
653655
"bandit[toml]>=1.7.0",
656+
"hypothesis>=6.0.0",
657+
"psutil>=5.9.0",
658+
"scikit-learn>=1.3.0",
659+
"pyarrow>=14.0.0",
654660
]
655661
visualization = [
656662
"matplotlib>=3.7.0",

tests/feeds/test_hyperliquid_dydx_pancakeswap_ripio_request_data.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
from typing import Any
22

3+
import pytest
4+
5+
pytest.importorskip("eth_account")
6+
37
from bt_api_py.feeds.live_dydx.request_base import DydxRequestData
48
from bt_api_py.feeds.live_hyperliquid.request_base import HyperliquidRequestData
59
from bt_api_py.feeds.live_pancakeswap.request_base import PancakeSwapRequestData

tests/functions/test_time_diff.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import socket
22
from datetime import UTC, datetime
33

4-
import ntplib
4+
import pytest
5+
6+
ntplib = pytest.importorskip("ntplib")
57

68

79
def get_network_time():

tests/monitoring/test_config.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
import pytest
44

5+
pytest.importorskip("psutil")
6+
57
from bt_api_py.monitoring import config as monitoring_config
68
from bt_api_py.monitoring.config import MonitoringConfig
79

tests/monitoring/test_elk.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
import pytest
77

8+
pytest.importorskip("psutil")
9+
810
from bt_api_py.monitoring import elk
911

1012

tests/monitoring/test_grafana.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
import json
44

5+
import pytest
6+
7+
pytest.importorskip("psutil")
8+
59
from bt_api_py.monitoring import grafana
610

711

tests/monitoring/test_metrics.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
"""Tests for monitoring/metrics.py."""
22

3+
import pytest
4+
5+
pytest.importorskip("psutil")
6+
37
from bt_api_py.monitoring.metrics import MetricValue
48

59

tests/monitoring/test_prometheus.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
import pytest
77

8+
pytest.importorskip("psutil")
9+
810
from bt_api_py.monitoring import prometheus
911
from bt_api_py.monitoring.metrics import Gauge, Histogram, MetricRegistry
1012

tests/test_advanced_connection_manager.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
import pytest
66

7+
pytest.importorskip("psutil")
8+
79
from bt_api_py.websocket.advanced_connection_manager import (
810
ConnectionHealth,
911
ConnectionState,

tests/test_analysis_log.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
import pytest
77

8+
pytest.importorskip("pyecharts")
9+
810
from bt_api_py.functions.analysis_log import (
911
TIME_PATTERN,
1012
_require_package_path,

0 commit comments

Comments
 (0)