LUCIT-Systems-and-Development / unicorn-binance-websocket-api

A Python SDK by LUCIT to use the Binance Websocket API`s (com+testnet, com-margin+testnet, com-isolated_margin+testnet, com-futures+testnet, com-coin_futures, us, tr, dex/chain+testnet) in a simple, fast, flexible, robust and fully-featured way.
https://unicorn-binance-websocket-api.docs.lucit.tech/
Other
677 stars 166 forks source link

Update requirements: remove pathlib #224

Closed esquire900 closed 2 years ago

esquire900 commented 2 years ago

Removing the pathlib dependency; it might interfere with some other projects and it's no longer needed. Pathlib is included in python core >= 3.5, this project required at least 3.7

oliver-zehentleitner commented 2 years ago

Do you have a link to proof that info?

Besides the requirements.txt file, dependencies are also defined in environment.yml and setup.py.

esquire900 commented 2 years ago

Pathlib was introduced in https://www.python.org/dev/peps/pep-0428/ and is part of the core library since at least 3.6: https://docs.python.org/3.6/library/pathlib.html

I am running into a weird bug when trying to install with poetry, where a function of pathlib is requested that exists in the core library, but not the pip version.

AttributeError: 'PosixPath' object has no attribute 'read_text' Similar to, for example: https://github.com/thedirtyfew/dash-extensions/issues/19

I suspect it's a pretty niche problem, but since pathlib should not be necessary, it might be simpler to remove the requirement altogether.

(Thank you for all your work on this package by the way, very helpful!)

oliver-zehentleitner commented 2 years ago

Thank you for this hint and PR!

Will be included within the next release!

papapon commented 2 years ago

@oliver-zehentleitner when do you plan to do a release?

If I try to install it (with poetry) from master, I get an error:

$ poetry add git+https://github.com/oliver-zehentleitner/unicorn-binance-websocket-api.git x PackageInfoError

Unable to determine package info for path: /tmp/pypoetry-git-unicorn-binance-websocket-apt4qgqv43

Fallback egg_info generation failed.

Command ['/tmp/tmpfoqpapo6/.venv/bin/python', 'setup.py', 'egg_info'] errored with the following return code 1, and output: Traceback (most recent call last): File "/tmp/pypoetry-git-unicorn-binance-websocket-apt4qgqv43/setup.py", line 37, in from unicorn_binance_websocket_api.unicorn_binance_websocket_api_manager import BinanceWebSocketApiManager File "/tmp/pypoetry-git-unicorn-binance-websocket-apt4qgqv43/unicorn_binance_websocket_api/init.py", line 2, in from unicorn_binance_websocket_api.unicorn_binance_websocket_api_connection import BinanceWebSocketApiConnection File "/tmp/pypoetry-git-unicorn-binance-websocket-apt4qgqv43/unicorn_binance_websocket_api/unicorn_binance_websocket_api_connection.py", line 43, in import websockets ModuleNotFoundError: No module named 'websockets'

at /usr/local/lib/python3.10/site-packages/poetry/inspection/info.py:500 in _pep517_metadata 496│ try: 497│ venv.run_python("setup.py", "egg_info") 498│ return cls.from_metadata(path) 499│ except EnvCommandError as fbe: → 500│ raise PackageInfoError( 501│ path, "Fallback egg_info generation failed.", fbe 502│ ) 503│ finally: 504│ os.chdir(cwd.as_posix())

oliver-zehentleitner commented 2 years ago

it was planed for now. in the next couple of days!

oliver-zehentleitner commented 2 years ago

Its released: https://github.com/LUCIT-Systems-and-Development/unicorn-binance-websocket-api/releases/tag/1.35.0