mirror of
https://github.com/microsoft/qlib.git
synced 2026-07-07 13:00:58 +08:00
fix(client): fix missing dependencies and unsafe pickle usage
This commit is contained in:
5
Makefile
5
Makefile
@@ -100,8 +100,11 @@ test:
|
||||
analysis:
|
||||
python -m pip install -e .[analysis]
|
||||
|
||||
client:
|
||||
python -m pip install -e .[client]
|
||||
|
||||
all:
|
||||
python -m pip install -e .[pywinpty,dev,lint,docs,package,test,analysis,rl]
|
||||
python -m pip install -e .[pywinpty,dev,lint,docs,package,test,analysis,rl,client]
|
||||
|
||||
install: prerequisite dependencies
|
||||
|
||||
|
||||
@@ -101,6 +101,10 @@ analysis = [
|
||||
"plotly",
|
||||
"statsmodels",
|
||||
]
|
||||
client = [
|
||||
"python-socketio<6",
|
||||
"tables",
|
||||
]
|
||||
|
||||
# In the process of releasing a new version, when checking the manylinux package with twine, an error is reported:
|
||||
# InvalidDistribution: Invalid distribution metadata: unrecognized or malformed field 'license-file'
|
||||
|
||||
@@ -2,15 +2,16 @@
|
||||
# Licensed under the MIT License.
|
||||
|
||||
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import division, print_function
|
||||
|
||||
import json
|
||||
|
||||
import socketio
|
||||
|
||||
import qlib
|
||||
|
||||
from ..config import C
|
||||
from ..log import get_module_logger
|
||||
import pickle
|
||||
|
||||
|
||||
class Client:
|
||||
@@ -96,7 +97,7 @@ class Client:
|
||||
self.logger.debug("connected")
|
||||
# The pickle is for passing some parameters with special type(such as
|
||||
# pd.Timestamp)
|
||||
request_content = {"head": head_info, "body": pickle.dumps(request_content, protocol=C.dump_protocol_version)}
|
||||
request_content = {"head": head_info, "body": json.dumps(request_content, default=str)}
|
||||
self.sio.on(request_type + "_response", request_callback)
|
||||
self.logger.debug("try sending")
|
||||
self.sio.emit(request_type + "_request", request_content)
|
||||
|
||||
Reference in New Issue
Block a user