xtquant-share 1.2.8__tar.gz → 1.2.9__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {xtquant_share-1.2.8 → xtquant_share-1.2.9}/PKG-INFO +1 -1
- {xtquant_share-1.2.8 → xtquant_share-1.2.9}/pyproject.toml +2 -2
- xtquant_share-1.2.9/xqshare/.env.example +26 -0
- {xtquant_share-1.2.8 → xtquant_share-1.2.9}/xqshare/server.py +28 -0
- {xtquant_share-1.2.8 → xtquant_share-1.2.9}/xtquant_share.egg-info/PKG-INFO +1 -1
- {xtquant_share-1.2.8 → xtquant_share-1.2.9}/xtquant_share.egg-info/SOURCES.txt +1 -0
- {xtquant_share-1.2.8 → xtquant_share-1.2.9}/LICENSE +0 -0
- {xtquant_share-1.2.8 → xtquant_share-1.2.9}/README.md +0 -0
- {xtquant_share-1.2.8 → xtquant_share-1.2.9}/setup.cfg +0 -0
- {xtquant_share-1.2.8 → xtquant_share-1.2.9}/tests/test_auth.py +0 -0
- {xtquant_share-1.2.8 → xtquant_share-1.2.9}/tests/test_client.py +0 -0
- {xtquant_share-1.2.8 → xtquant_share-1.2.9}/tests/test_client_permission.py +0 -0
- {xtquant_share-1.2.8 → xtquant_share-1.2.9}/tests/test_integration.py +0 -0
- {xtquant_share-1.2.8 → xtquant_share-1.2.9}/tests/test_server.py +0 -0
- {xtquant_share-1.2.8 → xtquant_share-1.2.9}/tests/test_server_permission.py +0 -0
- {xtquant_share-1.2.8 → xtquant_share-1.2.9}/tests/test_tools_common.py +0 -0
- {xtquant_share-1.2.8 → xtquant_share-1.2.9}/xqshare/__init__.py +0 -0
- {xtquant_share-1.2.8 → xtquant_share-1.2.9}/xqshare/auth.py +0 -0
- {xtquant_share-1.2.8 → xtquant_share-1.2.9}/xqshare/client.py +0 -0
- {xtquant_share-1.2.8 → xtquant_share-1.2.9}/xqshare/clients.yaml.example +0 -0
- {xtquant_share-1.2.8 → xtquant_share-1.2.9}/xqshare/qmt_datadir/__init__.py +0 -0
- {xtquant_share-1.2.8 → xtquant_share-1.2.9}/xqshare/qmt_datadir/divid.py +0 -0
- {xtquant_share-1.2.8 → xtquant_share-1.2.9}/xqshare/qmt_datadir/kline.py +0 -0
- {xtquant_share-1.2.8 → xtquant_share-1.2.9}/xqshare/qmt_datadir/misc.py +0 -0
- {xtquant_share-1.2.8 → xtquant_share-1.2.9}/xqshare/qmt_datadir/reader.py +0 -0
- {xtquant_share-1.2.8 → xtquant_share-1.2.9}/xqshare/qmt_datadir/sector.py +0 -0
- {xtquant_share-1.2.8 → xtquant_share-1.2.9}/xqshare/tools/__init__.py +0 -0
- {xtquant_share-1.2.8 → xtquant_share-1.2.9}/xqshare/tools/common.py +0 -0
- {xtquant_share-1.2.8 → xtquant_share-1.2.9}/xqshare/tools/xtdata.py +0 -0
- {xtquant_share-1.2.8 → xtquant_share-1.2.9}/xqshare/tools/xttrader.py +0 -0
- {xtquant_share-1.2.8 → xtquant_share-1.2.9}/xtquant_share.egg-info/dependency_links.txt +0 -0
- {xtquant_share-1.2.8 → xtquant_share-1.2.9}/xtquant_share.egg-info/entry_points.txt +0 -0
- {xtquant_share-1.2.8 → xtquant_share-1.2.9}/xtquant_share.egg-info/requires.txt +0 -0
- {xtquant_share-1.2.8 → xtquant_share-1.2.9}/xtquant_share.egg-info/top_level.txt +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "xtquant-share"
|
|
7
|
-
version = "1.2.
|
|
7
|
+
version = "1.2.9"
|
|
8
8
|
description = "Xtreme Quant Share - eXtreme transparent sharing proxy for XtQuant on macOS/Linux"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "GPL-3.0-only"
|
|
@@ -70,4 +70,4 @@ where = ["."]
|
|
|
70
70
|
include = ["xqshare*"]
|
|
71
71
|
|
|
72
72
|
[tool.setuptools.package-data]
|
|
73
|
-
"*" = ["*.md", "*.txt", "*.yaml", "*.example"]
|
|
73
|
+
"*" = ["*.md", "*.txt", "*.yaml", "*.example", ".env.example"]
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# xqshare 服务端环境变量配置
|
|
2
|
+
# 此文件由 xqshare-server 首次启动时自动生成
|
|
3
|
+
# 请根据你的实际环境修改以下配置,然后重新启动服务
|
|
4
|
+
|
|
5
|
+
# ==================== 服务配置 ====================
|
|
6
|
+
# 服务监听端口
|
|
7
|
+
XQSHARE_PORT=18812
|
|
8
|
+
|
|
9
|
+
# ==================== QMT 配置 ====================
|
|
10
|
+
# QMT 客户端 userdata_mini 目录路径(必填)
|
|
11
|
+
# 示例:QMT_USERDATA_PATH=C:\QMT\userdata_mini
|
|
12
|
+
QMT_USERDATA_PATH=C:\QMT\userdata_mini
|
|
13
|
+
|
|
14
|
+
# 默认资金账号(可选)
|
|
15
|
+
# QMT_ACCOUNT_ID=你的资金账号
|
|
16
|
+
|
|
17
|
+
# QMT datadir 文件解析路径(用于 xqshare.datadir 功能)
|
|
18
|
+
# 优先级:QMT_DATADIR_PATH > xtdata.get_data_dir() 自动推断
|
|
19
|
+
# 若不配置,系统将尝试通过 xtdata.get_data_dir() 自动推断主数据目录
|
|
20
|
+
# 示例(国金证券):QMT_DATADIR_PATH=D:\国金证券QMT交易端\datadir
|
|
21
|
+
# 示例(通用路径):QMT_DATADIR_PATH=C:\QMT\datadir
|
|
22
|
+
# QMT_DATADIR_PATH=
|
|
23
|
+
|
|
24
|
+
# ==================== 日志配置 ====================
|
|
25
|
+
# 日志级别: DEBUG, INFO, WARNING, ERROR
|
|
26
|
+
LOG_LEVEL=INFO
|
|
@@ -703,6 +703,31 @@ def _init_clients_yaml():
|
|
|
703
703
|
logger.warning(f"自动复制 clients.yaml.example 失败: {e}")
|
|
704
704
|
|
|
705
705
|
|
|
706
|
+
def _init_env_file():
|
|
707
|
+
"""
|
|
708
|
+
如果当前工作目录下不存在 .env 文件,则从包目录复制示例文件。
|
|
709
|
+
|
|
710
|
+
这样用户 pip install 后首次运行即可得到一份带注释的 .env 模板,
|
|
711
|
+
避免因缺少配置文件而导致服务无法正常启动。
|
|
712
|
+
"""
|
|
713
|
+
import shutil
|
|
714
|
+
target = os.path.join(os.getcwd(), ".env")
|
|
715
|
+
if os.path.exists(target):
|
|
716
|
+
return # 已存在,跳过
|
|
717
|
+
|
|
718
|
+
# 从包目录查找示例文件
|
|
719
|
+
example_path = os.path.join(os.path.dirname(__file__), ".env.example")
|
|
720
|
+
if not os.path.exists(example_path):
|
|
721
|
+
return # 示例文件也不存在(不应发生)
|
|
722
|
+
|
|
723
|
+
try:
|
|
724
|
+
shutil.copyfile(example_path, target)
|
|
725
|
+
print(f" \u2714 已生成 .env 配置文件")
|
|
726
|
+
print(f" ⚠ 请编辑 .env 文件,设置 QMT_USERDATA_PATH 等必要配置后重新启动服务")
|
|
727
|
+
except Exception as e:
|
|
728
|
+
logger.warning(f"自动复制 .env.example 失败: {e}")
|
|
729
|
+
|
|
730
|
+
|
|
706
731
|
# ==================== datadir 初始化 ====================
|
|
707
732
|
|
|
708
733
|
def _init_datadir_reader():
|
|
@@ -806,6 +831,9 @@ def start_server(host="0.0.0.0", port=None, use_ssl=False, certfile=None, keyfil
|
|
|
806
831
|
print(f" 日志级别: {log_level}")
|
|
807
832
|
print("=" * 70)
|
|
808
833
|
|
|
834
|
+
# ── 自动生成 .env(首次启动时拷贝模板) ───────────────────────
|
|
835
|
+
_init_env_file()
|
|
836
|
+
|
|
809
837
|
# ── 自动生成 clients.yaml ──────────────────────────────────────
|
|
810
838
|
_init_clients_yaml()
|
|
811
839
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|