mirror of
https://github.com/microsoft/qlib.git
synced 2026-07-17 01:14:35 +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:
|
analysis:
|
||||||
python -m pip install -e .[analysis]
|
python -m pip install -e .[analysis]
|
||||||
|
|
||||||
|
client:
|
||||||
|
python -m pip install -e .[client]
|
||||||
|
|
||||||
all:
|
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
|
install: prerequisite dependencies
|
||||||
|
|
||||||
|
|||||||
@@ -101,6 +101,10 @@ analysis = [
|
|||||||
"plotly",
|
"plotly",
|
||||||
"statsmodels",
|
"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:
|
# 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'
|
# InvalidDistribution: Invalid distribution metadata: unrecognized or malformed field 'license-file'
|
||||||
|
|||||||
@@ -2,15 +2,16 @@
|
|||||||
# Licensed under the MIT License.
|
# Licensed under the MIT License.
|
||||||
|
|
||||||
|
|
||||||
from __future__ import division
|
from __future__ import division, print_function
|
||||||
from __future__ import print_function
|
|
||||||
|
import json
|
||||||
|
|
||||||
import socketio
|
import socketio
|
||||||
|
|
||||||
import qlib
|
import qlib
|
||||||
|
|
||||||
from ..config import C
|
from ..config import C
|
||||||
from ..log import get_module_logger
|
from ..log import get_module_logger
|
||||||
import pickle
|
|
||||||
|
|
||||||
|
|
||||||
class Client:
|
class Client:
|
||||||
@@ -96,7 +97,7 @@ class Client:
|
|||||||
self.logger.debug("connected")
|
self.logger.debug("connected")
|
||||||
# The pickle is for passing some parameters with special type(such as
|
# The pickle is for passing some parameters with special type(such as
|
||||||
# pd.Timestamp)
|
# 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.sio.on(request_type + "_response", request_callback)
|
||||||
self.logger.debug("try sending")
|
self.logger.debug("try sending")
|
||||||
self.sio.emit(request_type + "_request", request_content)
|
self.sio.emit(request_type + "_request", request_content)
|
||||||
|
|||||||
Reference in New Issue
Block a user