danwen-eval 0.1.0__py3-none-any.whl

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.
@@ -0,0 +1 @@
1
+ """但问智测品牌安装与命令行入口;底层依赖MLflow。"""
@@ -0,0 +1,3 @@
1
+ from .cli import main
2
+
3
+ raise SystemExit(main())
danwen_eval/cli.py ADDED
@@ -0,0 +1,48 @@
1
+ """Thin CLI wrapper: preserve upstream arguments, exit status and process signals."""
2
+ from importlib import metadata
3
+ import os
4
+ import sys
5
+
6
+ HELP = """但问智测 · 智能体评测平台
7
+ 北京慧测 · 但问智能
8
+
9
+ 用法:
10
+ danwen server [参数] 启动底层服务
11
+ danwen server --help 查看服务参数
12
+ danwen --version 查看封装包与底层版本
13
+ python -m danwen_eval ... 等价模块入口
14
+
15
+ 除本页帮助和--version外,参数原样转交MLflow CLI。
16
+ 本包仅封装安装和启动,不修改MLflow网页、API或Python SDK。
17
+ 官网:www.huicewang.com | 官方微信:huice666
18
+ """
19
+
20
+
21
+ def _version(name):
22
+ try:
23
+ return metadata.version(name)
24
+ except metadata.PackageNotFoundError:
25
+ return None
26
+
27
+
28
+ def main(argv=None):
29
+ args = list(sys.argv[1:] if argv is None else argv)
30
+ if not args or args in (["--help"], ["-h"]):
31
+ print(HELP)
32
+ return 0
33
+ if args == ["--version"]:
34
+ print(f"但问智测 danwen-eval {_version('danwen-eval') or 'not-installed'}")
35
+ print(f"MLflow backend {_version('mlflow') or 'not-installed'}")
36
+ return 0
37
+ if _version("mlflow") is None:
38
+ print("缺少MLflow依赖,请在当前Python环境重新安装danwen-eval(不要使用--no-deps)。", file=sys.stderr)
39
+ return 2
40
+ try:
41
+ # No shell, no argument interpolation. Replace the wrapper process rather
42
+ # than orphaning a long-lived server behind an extra subprocess layer.
43
+ # POSIX signal/exit behavior is verified; Windows requires separate QA.
44
+ os.execv(sys.executable, [sys.executable, "-m", "mlflow", *args])
45
+ except OSError as exc:
46
+ print(f"无法启动底层命令:{exc}", file=sys.stderr)
47
+ return 126
48
+ return 0 # Only reachable with an execv test double.
@@ -0,0 +1,202 @@
1
+ Copyright 2018 Databricks, Inc. All rights reserved.
2
+
3
+ Apache License
4
+ Version 2.0, January 2004
5
+ http://www.apache.org/licenses/
6
+
7
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
8
+
9
+ 1. Definitions.
10
+
11
+ "License" shall mean the terms and conditions for use, reproduction,
12
+ and distribution as defined by Sections 1 through 9 of this document.
13
+
14
+ "Licensor" shall mean the copyright owner or entity authorized by
15
+ the copyright owner that is granting the License.
16
+
17
+ "Legal Entity" shall mean the union of the acting entity and all
18
+ other entities that control, are controlled by, or are under common
19
+ control with that entity. For the purposes of this definition,
20
+ "control" means (i) the power, direct or indirect, to cause the
21
+ direction or management of such entity, whether by contract or
22
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
23
+ outstanding shares, or (iii) beneficial ownership of such entity.
24
+
25
+ "You" (or "Your") shall mean an individual or Legal Entity
26
+ exercising permissions granted by this License.
27
+
28
+ "Source" form shall mean the preferred form for making modifications,
29
+ including but not limited to software source code, documentation
30
+ source, and configuration files.
31
+
32
+ "Object" form shall mean any form resulting from mechanical
33
+ transformation or translation of a Source form, including but
34
+ not limited to compiled object code, generated documentation,
35
+ and conversions to other media types.
36
+
37
+ "Work" shall mean the work of authorship, whether in Source or
38
+ Object form, made available under the License, as indicated by a
39
+ copyright notice that is included in or attached to the work
40
+ (an example is provided in the Appendix below).
41
+
42
+ "Derivative Works" shall mean any work, whether in Source or Object
43
+ form, that is based on (or derived from) the Work and for which the
44
+ editorial revisions, annotations, elaborations, or other modifications
45
+ represent, as a whole, an original work of authorship. For the purposes
46
+ of this License, Derivative Works shall not include works that remain
47
+ separable from, or merely link (or bind by name) to the interfaces of,
48
+ the Work and Derivative Works thereof.
49
+
50
+ "Contribution" shall mean any work of authorship, including
51
+ the original version of the Work and any modifications or additions
52
+ to that Work or Derivative Works thereof, that is intentionally
53
+ submitted to Licensor for inclusion in the Work by the copyright owner
54
+ or by an individual or Legal Entity authorized to submit on behalf of
55
+ the copyright owner. For the purposes of this definition, "submitted"
56
+ means any form of electronic, verbal, or written communication sent
57
+ to the Licensor or its representatives, including but not limited to
58
+ communication on electronic mailing lists, source code control systems,
59
+ and issue tracking systems that are managed by, or on behalf of, the
60
+ Licensor for the purpose of discussing and improving the Work, but
61
+ excluding communication that is conspicuously marked or otherwise
62
+ designated in writing by the copyright owner as "Not a Contribution."
63
+
64
+ "Contributor" shall mean Licensor and any individual or Legal Entity
65
+ on behalf of whom a Contribution has been received by Licensor and
66
+ subsequently incorporated within the Work.
67
+
68
+ 2. Grant of Copyright License. Subject to the terms and conditions of
69
+ this License, each Contributor hereby grants to You a perpetual,
70
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
71
+ copyright license to reproduce, prepare Derivative Works of,
72
+ publicly display, publicly perform, sublicense, and distribute the
73
+ Work and such Derivative Works in Source or Object form.
74
+
75
+ 3. Grant of Patent License. Subject to the terms and conditions of
76
+ this License, each Contributor hereby grants to You a perpetual,
77
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
78
+ (except as stated in this section) patent license to make, have made,
79
+ use, offer to sell, sell, import, and otherwise transfer the Work,
80
+ where such license applies only to those patent claims licensable
81
+ by such Contributor that are necessarily infringed by their
82
+ Contribution(s) alone or by combination of their Contribution(s)
83
+ with the Work to which such Contribution(s) was submitted. If You
84
+ institute patent litigation against any entity (including a
85
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
86
+ or a Contribution incorporated within the Work constitutes direct
87
+ or contributory patent infringement, then any patent licenses
88
+ granted to You under this License for that Work shall terminate
89
+ as of the date such litigation is filed.
90
+
91
+ 4. Redistribution. You may reproduce and distribute copies of the
92
+ Work or Derivative Works thereof in any medium, with or without
93
+ modifications, and in Source or Object form, provided that You
94
+ meet the following conditions:
95
+
96
+ (a) You must give any other recipients of the Work or
97
+ Derivative Works a copy of this License; and
98
+
99
+ (b) You must cause any modified files to carry prominent notices
100
+ stating that You changed the files; and
101
+
102
+ (c) You must retain, in the Source form of any Derivative Works
103
+ that You distribute, all copyright, patent, trademark, and
104
+ attribution notices from the Source form of the Work,
105
+ excluding those notices that do not pertain to any part of
106
+ the Derivative Works; and
107
+
108
+ (d) If the Work includes a "NOTICE" text file as part of its
109
+ distribution, then any Derivative Works that You distribute must
110
+ include a readable copy of the attribution notices contained
111
+ within such NOTICE file, excluding those notices that do not
112
+ pertain to any part of the Derivative Works, in at least one
113
+ of the following places: within a NOTICE text file distributed
114
+ as part of the Derivative Works; within the Source form or
115
+ documentation, if provided along with the Derivative Works; or,
116
+ within a display generated by the Derivative Works, if and
117
+ wherever such third-party notices normally appear. The contents
118
+ of the NOTICE file are for informational purposes only and
119
+ do not modify the License. You may add Your own attribution
120
+ notices within Derivative Works that You distribute, alongside
121
+ or as an addendum to the NOTICE text from the Work, provided
122
+ that such additional attribution notices cannot be construed
123
+ as modifying the License.
124
+
125
+ You may add Your own copyright statement to Your modifications and
126
+ may provide additional or different license terms and conditions
127
+ for use, reproduction, or distribution of Your modifications, or
128
+ for any such Derivative Works as a whole, provided Your use,
129
+ reproduction, and distribution of the Work otherwise complies with
130
+ the conditions stated in this License.
131
+
132
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
133
+ any Contribution intentionally submitted for inclusion in the Work
134
+ by You to the Licensor shall be under the terms and conditions of
135
+ this License, without any additional terms or conditions.
136
+ Notwithstanding the above, nothing herein shall supersede or modify
137
+ the terms of any separate license agreement you may have executed
138
+ with Licensor regarding such Contributions.
139
+
140
+ 6. Trademarks. This License does not grant permission to use the trade
141
+ names, trademarks, service marks, or product names of the Licensor,
142
+ except as required for reasonable and customary use in describing the
143
+ origin of the Work and reproducing the content of the NOTICE file.
144
+
145
+ 7. Disclaimer of Warranty. Unless required by applicable law or
146
+ agreed to in writing, Licensor provides the Work (and each
147
+ Contributor provides its Contributions) on an "AS IS" BASIS,
148
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
149
+ implied, including, without limitation, any warranties or conditions
150
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
151
+ PARTICULAR PURPOSE. You are solely responsible for determining the
152
+ appropriateness of using or redistributing the Work and assume any
153
+ risks associated with Your exercise of permissions under this License.
154
+
155
+ 8. Limitation of Liability. In no event and under no legal theory,
156
+ whether in tort (including negligence), contract, or otherwise,
157
+ unless required by applicable law (such as deliberate and grossly
158
+ negligent acts) or agreed to in writing, shall any Contributor be
159
+ liable to You for damages, including any direct, indirect, special,
160
+ incidental, or consequential damages of any character arising as a
161
+ result of this License or out of the use or inability to use the
162
+ Work (including but not limited to damages for loss of goodwill,
163
+ work stoppage, computer failure or malfunction, or any and all
164
+ other commercial damages or losses), even if such Contributor
165
+ has been advised of the possibility of such damages.
166
+
167
+ 9. Accepting Warranty or Additional Liability. While redistributing
168
+ the Work or Derivative Works thereof, You may choose to offer,
169
+ and charge a fee for, acceptance of support, warranty, indemnity,
170
+ or other liability obligations and/or rights consistent with this
171
+ License. However, in accepting such obligations, You may act only
172
+ on Your own behalf and on Your sole responsibility, not on behalf
173
+ of any other Contributor, and only if You agree to indemnify,
174
+ defend, and hold each Contributor harmless for any liability
175
+ incurred by, or claims asserted against, such Contributor by reason
176
+ of your accepting any such warranty or additional liability.
177
+
178
+ END OF TERMS AND CONDITIONS
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,10 @@
1
+ MLflow 3.17.2
2
+ Source: https://github.com/mlflow/mlflow/tree/v3.17.2
3
+ License source: https://raw.githubusercontent.com/mlflow/mlflow/v3.17.2/LICENSE.txt
4
+ License: Apache License 2.0
5
+ Copyright notice is retained in MLflow-LICENSE.txt.
6
+
7
+ This package supplies a separate Danwen installation and CLI wrapper. It does not
8
+ rename or claim authorship of the MLflow engine. MLflow is installed as a separate
9
+ dependency; its installed distribution retains its own license files/notices.
10
+ Other transitive dependencies retain their respective licenses.
@@ -0,0 +1,92 @@
1
+ Metadata-Version: 2.4
2
+ Name: danwen-eval
3
+ Version: 0.1.0
4
+ Summary: Danwen branded installation and CLI wrapper for MLflow
5
+ Author: 但问智能
6
+ Project-URL: Homepage, https://www.huicewang.com
7
+ Requires-Python: >=3.10
8
+ Description-Content-Type: text/markdown
9
+ License-File: LICENSE_POLICY.md
10
+ Requires-Dist: mlflow==3.17.2
11
+ Provides-Extra: test
12
+ Requires-Dist: pytest<10,>=8; extra == "test"
13
+ Dynamic: license-file
14
+
15
+ # 但问智测 · danwen-eval
16
+
17
+ 北京慧测 · 但问智能 | www.huicewang.com | 官方微信 huice666
18
+
19
+ ## 本次交付的定位
20
+
21
+ 这是安装与启动封装,不是MLflow源码改名或独立评测引擎。产品名但问智测,Python分发名danwen-eval,模块名danwen_eval,命令名danwen。底层依赖固定为mlflow==3.17.2。不会改变上游网页Logo、标题、路由、SDK/API、认证、存储格式或模型配置。
22
+
23
+ 当前为本地构建的0.1.0交付包,**未发布PyPI、没有注册包名,也没有创建线上服务**。在公司正式发布之前,不能宣称直接执行`pip install danwen-eval`就能安装本次包。
24
+
25
+ ## 1. 安装交付的wheel(当前即可使用)
26
+
27
+ 建议Python3.10及以上,优先使用独立虚拟环境。请先检查交付校验文件,再安装。
28
+
29
+ ```bash
30
+ python -m venv .venv
31
+ # Linux / macOS
32
+ source .venv/bin/activate
33
+ # Windows PowerShell改用:.\.venv\Scripts\Activate.ps1
34
+ python -m pip install --upgrade pip
35
+ python -m pip install ./packages/danwen_eval-0.1.0-py3-none-any.whl
36
+ danwen --version
37
+ danwen server --help
38
+ ```
39
+
40
+ wheel不包含底层MLflow及其传递依赖;安装时需能够从配置的可信包源下载依赖。仅有本wheel不构成离线安装包。
41
+
42
+ ## 2. 本地启动
43
+
44
+ ```bash
45
+ danwen server --host 127.0.0.1 --port 5000
46
+ ```
47
+
48
+ 浏览器访问http://127.0.0.1:5000。服务器运行在前台,使用Ctrl+C停止。默认数据库与Artifact行为继承上游;请在固定工作目录运行,先验证再迁移实际资产。
49
+
50
+ 也可以显式设置数据库与文件Artifact根(示例路径需确保可写):
51
+
52
+ ```bash
53
+ danwen server --host 127.0.0.1 --port 5000 \
54
+ --backend-store-uri sqlite:///danwen.db \
55
+ --default-artifact-root ./artifacts
56
+ ```
57
+
58
+ 模块入口等价:`python -m danwen_eval server --help`。除`danwen --help/-h`和`danwen --version`外,参数原样传递给上游CLI,包含未知参数和上游返回码。客户端仍使用真实`mlflow` SDK及`MLFLOW_TRACKING_URI`。
59
+
60
+ ## 3. 远程访问与安全边界
61
+
62
+ 若要让客户远程连接,需另行配置监听地址、上游allowed-hosts、反向代理TLS、认证与网络访问控制。不要在公网直接暴露未经认证的服务,也不要将allowed-hosts设置为通配符作为生产配置。公司包名不会自动提供登录、RBAC、数据隔离或企业许可校验。
63
+
64
+ ## 4. 源码开发与测试
65
+
66
+ 在project目录下执行:
67
+
68
+ ```bash
69
+ python -m pip install -e '.[test]'
70
+ python -m pytest -q
71
+ ```
72
+
73
+ ## 5. 构建与发布
74
+
75
+ 详见docs/发布与维护指南.md。公开PyPI、私有仓库和离线分发是不同的交付方式。发布账户、包名所有权、软件许可和生产安全需由公司确认。
76
+
77
+ ## 第三方来源
78
+
79
+ 底层MLflow:https://github.com/mlflow/mlflow ,Apache License 2.0。上游原名、版权与许可保留;本包不声明上游引擎为自主原创。许可证及说明随wheel中的danwen_eval/third_party交付。公司自有封装代码许可在正式对外发布前另行确认,见LICENSE_POLICY.md。
80
+
81
+ ## 本次服务验证与资源提示
82
+
83
+ 在Linux/Python3.13独立虚拟环境,wheel安装和14项测试通过。真实服务HTTP验证采用单worker,显式设置`MLFLOW_SERVER_ENABLE_JOB_EXECUTION=false`:首页、/version、/health均200,服务正常关闭。这只验证基础服务,不验证后台评测任务。
84
+
85
+ 首次保留默认后台任务的尝试到达启动日志后进程被终止,未完成HTTP验收,终止根因未确定。低资源环境可临时用以下命令排查基础启动;这不是完整功能或生产建议:
86
+
87
+ ```bash
88
+ # Linux / macOS,仅基础服务排查;禁用后台任务会影响相关异步功能
89
+ MLFLOW_SERVER_ENABLE_JOB_EXECUTION=false danwen server --host 127.0.0.1 --port 5000 --workers 1
90
+ ```
91
+
92
+ Windows PowerShell需先设置`$env:MLFLOW_SERVER_ENABLE_JOB_EXECUTION="false"`,排查后移除该环境变量;Windows本次未实测。正式使用后台任务前需单独验证资源、依赖、任务执行与停止行为。封装包自身不会默认关闭后台任务,也不会自动降低上游worker数量。
@@ -0,0 +1,11 @@
1
+ danwen_eval/__init__.py,sha256=dC27ds8HSptaOphsQbkClCN0zL6g_esLp6XjjBd8Ht0,73
2
+ danwen_eval/__main__.py,sha256=k1ocEWawweo1qCJWNFAAvyxz3tcY13dzvCenHszij30,48
3
+ danwen_eval/cli.py,sha256=MfQ-yJZQtIKC9v_5Tubkw-_FHEe7Avh-I_jxU4wpY_E,1819
4
+ danwen_eval/third_party/MLflow-LICENSE.txt,sha256=Y5U1Xebzka__NZlqMPtBsYm0mRpMtUmTrONatpoL-ig,11382
5
+ danwen_eval/third_party/THIRD_PARTY_NOTICES.txt,sha256=azFQT7aVQth72D0-Vs19XB2XvLd8N0s__X4QP4E4vwU,540
6
+ danwen_eval-0.1.0.dist-info/licenses/LICENSE_POLICY.md,sha256=knvqfd1oONA0gsXawk_uyIGPekrOyvmildru1uRn358,491
7
+ danwen_eval-0.1.0.dist-info/METADATA,sha256=Yfw_5utqk0BUpyirK-LGXGG4ImeBuUOiYwTGLhQ6ty8,4502
8
+ danwen_eval-0.1.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
9
+ danwen_eval-0.1.0.dist-info/entry_points.txt,sha256=_a312iYIRnJE0lxbHMfhEvv5CgbXeh4_aDLVH8Wj8oc,48
10
+ danwen_eval-0.1.0.dist-info/top_level.txt,sha256=VG0xpX30PhsQ8i9r-oWzSPus4700oefHs64F2rZZWrs,12
11
+ danwen_eval-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.2.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ danwen = danwen_eval.cli:main
@@ -0,0 +1,5 @@
1
+ # 自有代码许可确认
2
+
3
+ 本工程由但问智能用于评估与构建自有品牌安装入口。自有封装代码正式对外分发所采用的许可条款,应由但问智能确认;本工程不擅自为公司选择开源许可证或授予商业授权。
4
+
5
+ 底层MLflow及其他第三方组件按各自许可证使用。本说明不改变其许可,不宣称拥有第三方原始代码的独占权利。若选择商业发行,需另行确认EULA、商标、支持与责任边界。
@@ -0,0 +1 @@
1
+ danwen_eval