alpacahq / alpacahq/alpaca-py

[Bug]: DeprecationWarning: websockets.legacy is deprecated

Đang mở
#561 2 bình luận 1 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
1.5k
Fork
398
Merge trung bình
1 ngày 16 giờ
Pull request đã merge (30 ngày)
6

Mô tả

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Current Behavior

A recent version of the package `websockets` reports a deprecation warning when websockets.legacy is used:

> ../../../Library/Caches/pypoetry/virtualenvs/stocktrader-BHJNSc0O-py3.11/lib/python3.11/site-packages/websockets/legacy/__init__.py:6
> /Users/myuser/Library/Caches/pypoetry/virtualenvs/stocktrader-BHJNSc0O-py3.11/lib/python3.11/site-packages/websockets/legacy/__init__.py:6: DeprecationWarning: websockets.legacy is deprecated; see https://websockets.readthedocs.io/en/stable/howto/upgrade.html for upgrade instructions
> warnings.warn( # deprecated in 14.0 - 2024-11-09
>
> -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html

It appears websockets.legacy is being used in [stream](https://github.com/alpacahq/alpaca-py/blob/7fa0a94053a2c91168aa7df91b3f916879fcc290/alpaca/trading/stream.py#L9) and [websocket](https://github.com/alpacahq/alpaca-py/blob/7fa0a94053a2c91168aa7df91b3f916879fcc290/alpaca/data/live/websocket.py#L10)

### Expected Behavior

We should not be using deprecated packages

### SDK Version I encountered this issue in

0.38.0

### Steps To Reproduce

```markdown
- Use the latest version of websockets, i.e. ^14.2
- Run code that uses Alpaca's TradingStream
```

### Filled out the Steps to Reproduce section?

- [x] I have entered valid steps to reproduce my issue or have attached a minimally reproducible case in code that shows my issue happening; and understand that without this my issue will be flagged as invalid and closed after 30 days.

### Anything else?

_No response_

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.