alpacahq / alpacahq/alpaca-py

[Bug]: DeprecationWarning: websockets.legacy is deprecated

Ouverte
#561 2 commentaires 1 réaction 0 personnes assignées Voir sur GitHub
Langage dominant
Python
Étoiles
1.5k
Forks
397
Merge moyen
1 j 16 h
PR mergées (30 j)
6

Description

### 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_

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.