支持 macOS 下使用 OpenCTP dylib 构建 - #14
Merged
Merged
Conversation
Member
|
不好意思 没有看到此 问下你这个在三个系统下是否都能构建成功 |
Contributor
Author
|
linux 和 macOS CI 已通过。Windows CI 现在卡在 queued,我看有十多个小时了。不过我刚刚本地 Windows + Python 3.10.9 验证 |
Member
|
那我合并了 你跑过就行 |
Member
|
我发布一个新版本 |
Member
|
我提交了到pypi了 你看看能不能使用验证下 |
Member
|
windows是因为前面使用的win-2019 现在估计不支持了 我换成了windows-latest
…On Mon, May 18, 2026 at 12:00 PM Ruifeng Xue ***@***.***> wrote:
*Yong-yuan-X* left a comment (ctpbee/ctpbee_api#14)
<#14 (comment)>
linux 和 macOS CI 已通过。Windows CI 现在卡在 queued,我看有十多个小时了。不过我刚刚本地 Windows +
Python 3.10.9 验证 python setup.py build 成功,构建后的 ctp / ctp_mini / rohon
扩展模块也可以正常 import。这个改动只影响 Darwin/macOS 分支,Windows/Linux 仍走原有逻辑
—
Reply to this email directly, view it on GitHub
<#14 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHDQGFPZ5TMBM5ZAIDH6ZV343KDHLAVCNFSM6AAAAACY5OPKF6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DINZUGE4DCNZRGQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you commented.Message ID:
***@***.***>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
关联 issue: ctpbee/ctpbee#325
我在 macOS 本地复现了一下,当前
ctpbee_api在 macOS 下编译生成的vnctpmd/vnctptd默认链接到~/.ctpbee/Frameworks下的 framework:因此,即使把 OpenCTP 的
.dylib文件复制到ctpbee_api/ctp目录,现有构建产物也不会加载这些 dylib。本 PR 增加了一个可选环境变量:
当该环境变量存在时,macOS 构建会使用该目录下的 OpenCTP dylib,并将 dylib 复制到
ctpbee_api/ctp包目录中,保证运行时可以通过@loader_path正确加载。目前兼容以下文件名:如果没有设置
CTPBEE_CTP_DYLIB_DIR,则保持原有 framework 构建逻辑不变。我使用 PyPI 上的
openctp-ctpwheel 解压出的 dylib 进行了验证:CTPBEE_CTP_DYLIB_DIR=/Users/a1-6/Downloads/openctp-wheel/unpacked/openctp_ctp \ python -m pip install -e .安装后执行:
python -c "from ctpbee_api.ctp import MdApi, TdApi; print(MdApi, TdApi)"可以正常导入:
otool -L输出变为:说明构建产物已经从 framework 链接切换到 OpenCTP dylib。