3636# inworless <
[email protected] >, 2025.
37373838# rand777 <
[email protected] >, 2025.
39+ # monios <
[email protected] >, 2025.
3940msgid ""
4041msgstr ""
4142"Project-Id-Version: Python Packaging User Guide\n"
4243"Report-Msgid-Bugs-To: \n"
4344"POT-Creation-Date: 2025-11-10 19:13+0000\n"
44- "PO-Revision-Date: 2025-10-20 04:51+0000\n"
45- "Last-Translator: 大王叫我来巡山 "
46- 45+ "PO-Revision-Date: 2025-11-21 01:51+0000\n"
46+ "Last-Translator: monios <
[email protected] >\n"
4747"Language-Team: Chinese (Simplified Han script) <https://hosted.weblate.org/"
4848"projects/pypa/packaging-python-org/zh_Hans/>\n"
4949"Language: zh_Hans\n"
5050"MIME-Version: 1.0\n"
5151"Content-Type: text/plain; charset=UTF-8\n"
5252"Content-Transfer-Encoding: 8bit\n"
5353"Plural-Forms: nplurals=1; plural=0;\n"
54- "X-Generator: Weblate 5.14 -dev\n"
54+ "X-Generator: Weblate 5.15 -dev\n"
5555
5656#: ../source/contribute.rst:5
5757msgid "Contribute to this guide"
@@ -1219,44 +1219,50 @@ msgid ""
12191219"Downstream builds are frequently done in sandboxed environments that cannot "
12201220"access the Internet. The package sources are unpacked into this environment, "
12211221"and all the necessary dependencies are installed."
1222- msgstr ""
1222+ msgstr "下游构建通常在无法访问互联网的沙箱环境中进行。软件包源码会被解压到该环境中,"
1223+ "并安装所有必要的依赖项。"
12231224
12241225#: ../source/discussions/downstream-packaging.rst:156
12251226msgid ""
12261227"Even if this is not the case, and assuming that you took sufficient care to "
12271228"properly authenticate downloads, using the Internet is discouraged for a "
12281229"number of reasons:"
1229- msgstr ""
1230+ msgstr "即便不存在此类情况,且假设您已严格确保下载验证,出于多方面考虑,仍不建议在构"
1231+ "建过程中接入互联网:"
12301232
12311233#: ../source/discussions/downstream-packaging.rst:160
12321234msgid ""
12331235"The Internet connection may be unstable (e.g. due to poor reception) or "
12341236"suffer from temporary problems that could cause the process to fail or hang."
1235- msgstr ""
1237+ msgstr "网络连接可能不稳定(例如由于信号接收不佳),或存在临时性问题,这可能导致流程"
1238+ "执行失败或陷入停滞。"
12361239
12371240#: ../source/discussions/downstream-packaging.rst:164
12381241msgid ""
12391242"The remote resources may become temporarily or even permanently unavailable, "
12401243"making the build no longer possible. This is especially problematic when "
12411244"someone needs to build an old package version."
1242- msgstr ""
1245+ msgstr "远程资源可能会暂时甚至永久不可用,从而导致无法完成构建。当有人需要构建旧的软"
1246+ "件包版本时,这个问题尤其突出。"
12431247
12441248#: ../source/discussions/downstream-packaging.rst:168
12451249msgid "The remote resources may change, making the build not reproducible."
1246- msgstr ""
1250+ msgstr "远程资源可能发生变更,导致构建结果无法重现。 "
12471251
12481252#: ../source/discussions/downstream-packaging.rst:170
12491253msgid ""
12501254"Accessing remote servers poses a privacy issue and a potential security "
12511255"issue, as it exposes information about the system building the package."
1252- msgstr ""
1256+ msgstr "访问远程服务器会带来隐私泄露和潜在的安全风险,因为这会暴露执行软件包构建的系"
1257+ "统信息。"
12531258
12541259#: ../source/discussions/downstream-packaging.rst:174
12551260msgid ""
12561261"The user may be using a service with a limited data plan, in which "
12571262"uncontrolled Internet access may result in additional charges or other "
12581263"inconveniences."
1259- msgstr ""
1264+ msgstr "用户可能正在使用有限数据套餐的服务,此时无限制的网络访问可能导致产生额外费用"
1265+ "或引发其他不便。"
12601266
12611267#: ../source/discussions/downstream-packaging.rst:181
12621268msgid ""
@@ -1266,6 +1272,9 @@ msgid ""
12661272"all of these files or allow provisioning them externally, and the Internet "
12671273"must not be used if the files are already present."
12681274msgstr ""
1275+ "若软件包在实现自定义的*backend*构建操作时需访问互联网(例如自动下载供应商依赖"
1276+ "或获取Git子模块),其源码分发包必须包含所有这些文件,或允许通过外部方式预置这"
1277+ "些文件。当文件已存在时,严禁再次通过互联网获取。"
12691278
12701279#: ../source/discussions/downstream-packaging.rst:187
12711280msgid ""
@@ -1275,6 +1284,9 @@ msgid ""
12751284"Downstreams use frontends that use local provisioning for Python "
12761285"dependencies."
12771286msgstr ""
1287+ "需要注意的是,本条要求不适用于在软件包元数据中指定的Python依赖项——这些依赖项"
1288+ "由*frontends*(如 :ref:`build` 或 :ref:`pip`)在构建和安装过程中自动获取。下"
1289+ "游环节使用的前端工具会通过本地化方式配置Python依赖项。"
12781290
12791291#: ../source/discussions/downstream-packaging.rst:192
12801292msgid ""
@@ -1285,30 +1297,38 @@ msgid ""
12851297"disable all Internet access. This could be done e.g. by checking whether a "
12861298"``NO_NETWORK`` environment variable is set to a non-empty value."
12871299msgstr ""
1300+ "理想情况下,自定义构建脚本甚至不应尝试访问互联网,除非被明确要求这样做。如果"
1301+ "缺少任何需要获取的资源,它们应当先征得用户许可。若无法实现此机制,次优方案是"
1302+ "提供禁用所有网络访问的退出开关。例如,可通过检查 ``NO_NETWORK`` 环境变量是否"
1303+ "设置为非空值来实现。"
12881304
12891305#: ../source/discussions/downstream-packaging.rst:199
12901306msgid ""
12911307"Since downstreams frequently also run tests and build documentation, the "
12921308"above should ideally extend to these processes as well."
1293- msgstr ""
1309+ msgstr "考虑到下游环节通常还需执行测试及构建文档,理想情况下上述规范应同样适用于这些"
1310+ "流程。"
12941311
12951312#: ../source/discussions/downstream-packaging.rst:202
12961313msgid ""
12971314"Please also remember that if you are fetching remote resources, you "
12981315"absolutely must *verify their authenticity* (usually against a hash), to "
12991316"protect against the file being substituted by a malicious party."
1300- msgstr ""
1317+ msgstr "同时请务必注意,若需获取远程资源,您必须*核验其真实性*(通常需核对哈希值),"
1318+ "以防范文件被恶意方替换的风险。"
13011319
13021320#: ../source/discussions/downstream-packaging.rst:210
13031321msgid "Support building against system dependencies"
1304- msgstr ""
1322+ msgstr "支持针对系统依赖进行构建 "
13051323
13061324#: ../source/discussions/downstream-packaging.rst:215
13071325msgid ""
13081326"Some Python projects have non-Python dependencies, such as libraries written "
13091327"in C or C++. Trying to use the system versions of these dependencies in "
13101328"upstream packaging may cause a number of problems for end users:"
13111329msgstr ""
1330+ "某些Python项目包含非Python依赖项(例如使用C或C++编写的库)。在上游软件包构建"
1331+ "过程中尝试使用系统版本的这些依赖项,可能会给最终用户带来诸多问题:"
13121332
13131333#: ../source/discussions/downstream-packaging.rst:219
13141334msgid ""
@@ -1317,20 +1337,27 @@ msgid ""
13171337"incompatible version is installed, the Python package may fail with errors "
13181338"that are not clear to inexperienced users, or even misbehave at runtime."
13191339msgstr ""
1340+ "发布的wheel包要求用户系统必须存在二进制兼容版本的依赖库。若该库缺失或安装了不"
1341+ "兼容的版本,Python软件包可能会因报错信息对入门用户不够清晰而运行失败,甚至可"
1342+ "能在运行时出现异常行为。"
13201343
13211344#: ../source/discussions/downstream-packaging.rst:224
13221345msgid ""
13231346"Building from a source distribution requires a source-compatible version of "
13241347"the dependency to be present, along with its development headers and other "
13251348"auxiliary files that some systems package separately from the library itself."
13261349msgstr ""
1350+ "从源码分发版进行构建时,不仅要求存在源码兼容版本的依赖项,还需要其开发头文件"
1351+ "及其他辅助文件——这些组件在某些操作系统中会与主程序库本身分开打包。"
13271352
13281353#: ../source/discussions/downstream-packaging.rst:229
13291354msgid ""
13301355"Even for an experienced user, installing a compatible dependency version may "
13311356"be very hard. For example, the used Linux distribution may not provide the "
13321357"required version, or some other package may require an incompatible version."
13331358msgstr ""
1359+ "即便对于资深用户而言,安装兼容版本的依赖项也可能极为困难。例如,其所用的Linux"
1360+ "发行版可能未提供所需版本,亦或是其他软件包要求使用不兼容的版本。"
13341361
13351362#: ../source/discussions/downstream-packaging.rst:234
13361363msgid ""
@@ -1339,6 +1366,9 @@ msgid ""
13391366"library to a newer version that breaks binary compatibility with the Python "
13401367"package, and requires user intervention to fix."
13411368msgstr ""
1369+ "Python软件包与其系统依赖项之间的链接关系并未被包管理系统记录。后续的系统更新"
1370+ "可能会将程序库升级至与Python软件包二进制不兼容的新版本,从而需要用户手动干预"
1371+ "修复。"
13421372
13431373#: ../source/discussions/downstream-packaging.rst:239
13441374msgid ""
@@ -1348,13 +1378,17 @@ msgid ""
13481378"dependencies are also repackaged on PyPI, and can be declared as project "
13491379"dependencies like any other Python package."
13501380msgstr ""
1381+ "基于上述原因,您可以合理选择以下方案:静态链接依赖项,或在安装包中提供本地副"
1382+ "本。您也可以在源码分发版中内置依赖项。某些情况下,这些依赖项还会被重新打包至P"
1383+ "yPI,此时即可像声明普通Python包依赖那样将其列为项目依赖项。"
13511384
13521385#: ../source/discussions/downstream-packaging.rst:245
13531386msgid ""
13541387"However, none of these issues apply to downstream packaging, and downstreams "
13551388"have good reasons to prefer dynamically linking to system dependencies. In "
13561389"particular:"
1357- msgstr ""
1390+ msgstr "然而,这些问题均不适用于下游打包场景,且下游环节有充分理由倾向于动态链接系统"
1391+ "依赖项。具体而言:"
13581392
13591393#: ../source/discussions/downstream-packaging.rst:249
13601394msgid ""
@@ -1363,20 +1397,23 @@ msgid ""
13631397"support that makes it easier for users of those systems to access upstream "
13641398"projects in their preferred format."
13651399msgstr ""
1400+ "在许多情况下,可靠地在各组件间共享动态依赖项,正是下游打包生态系统的*purpose*"
1401+ "之一。支持这种机制能使这些系统的用户更便捷地以其偏好的格式获取上游项目。"
13661402
13671403#: ../source/discussions/downstream-packaging.rst:253
13681404msgid ""
13691405"Static linking and vendoring obscures the use of external dependencies, "
13701406"making source auditing harder."
1371- msgstr ""
1407+ msgstr "静态链接与内置依赖项会掩盖外部依赖的使用情况,增加源码审计的难度。 "
13721408
13731409#: ../source/discussions/downstream-packaging.rst:256
13741410msgid ""
13751411"Dynamic linking makes it possible to quickly and systematically replace the "
13761412"used libraries across an entire downstream packaging ecosystem, which can be "
13771413"particularly important when they turn out to contain a security "
13781414"vulnerability or critical bug."
1379- msgstr ""
1415+ msgstr "动态链接使得能够快速且系统性地在整个下游打包生态中替换所使用的程序库,这在发"
1416+ "现程序库存在安全漏洞或关键错误时显得尤为关键。"
13801417
13811418#: ../source/discussions/downstream-packaging.rst:260
13821419msgid ""
@@ -1386,6 +1423,9 @@ msgid ""
13861423"dependencies vendored in different packages. This can include compatibility "
13871424"improvements and security hardening."
13881425msgstr ""
1426+ "使用系统依赖可使软件包受益于下游定制化改进,从而在特定平台上提升用户体验,而"
1427+ "无需下游维护者对不同软件包中内置的依赖项进行持续修补。这类改进可能包括兼容性"
1428+ "优化与安全加固。"
13891429
13901430#: ../source/discussions/downstream-packaging.rst:266
13911431msgid ""
@@ -1396,12 +1436,17 @@ msgid ""
13961436"anything from library loading errors, to subtle runtime bugs, to "
13971437"catastrophic failures (like suddenly crashing and losing data)."
13981438msgstr ""
1439+ "静态链接与内置依赖可能导致同一进程加载多个不同版本的相同库(例如,尝试导入两"
1440+ "个链接至同一库不同版本的Python包)。这种情况有时能正常运行,但也可能引发从库"
1441+ "加载错误、微妙的运行时缺陷,到灾难性故障(如突然崩溃并丢失数据)等一系列问题"
1442+ "。"
13991443
14001444#: ../source/discussions/downstream-packaging.rst:273
14011445msgid ""
14021446"Last but not least, static linking and vendoring results in duplication, and "
14031447"may increase the use of both disk space and memory."
1404- msgstr ""
1448+ msgstr "最后同样重要的是,静态链接与内置依赖会导致资源重复,并可能显著增加磁盘空间和"
1449+ "内存的使用量。"
14051450
14061451#: ../source/discussions/downstream-packaging.rst:279
14071452msgid ""
@@ -1411,6 +1456,10 @@ msgid ""
14111456"for each dependency, and a general switch to control the default for them, "
14121457"e.g. via a ``USE_SYSTEM_DEPS`` environment variable."
14131458msgstr ""
1459+ "在满足双方需求方面,一个较好的折衷方案是提供在内置依赖与系统依赖之间切换的选"
1460+ "项。理想情况下,若软件包包含多个内置依赖项,应同时提供针对每个依赖项的独立切"
1461+ "换选项及控制默认行为的全局开关,例如通过 ``USE_VENDORED_DEPS`` 环境变量来实现"
1462+ "。"
14141463
14151464#: ../source/discussions/downstream-packaging.rst:285
14161465msgid ""
@@ -1420,6 +1469,9 @@ msgid ""
14201469"the opportunity to notice their mistake and a chance to consciously decide "
14211470"how to solve it."
14221471msgstr ""
1472+ "若用户请求使用系统依赖项,而特定依赖项缺失或不兼容时,构建过程应终止并给出解"
1473+ "释性提示信息,而非回退至内置版本。这能让打包人员及时察觉配置疏漏,并有机会自"
1474+ "主决定解决方案。"
14231475
14241476#: ../source/discussions/downstream-packaging.rst:291
14251477msgid ""
@@ -1429,10 +1481,13 @@ msgid ""
14291481"projects and downstream repackagers, not to suggest upstream projects take "
14301482"on tasks that downstream repackagers are better equipped to handle."
14311483msgstr ""
1484+ "对于上游项目而言,将系统依赖项的*testing*工作交由下游重打包者处理是合理的。这"
1485+ "些指导原则旨在促进上游项目与下游重打包者之间更高效的协作,而非建议上游项目承"
1486+ "担本应由更专业的下游重打包者完成的任务。"
14321487
14331488#: ../source/discussions/downstream-packaging.rst:300
14341489msgid "Support downstream testing"
1435- msgstr ""
1490+ msgstr "支持下游测试 "
14361491
14371492#: ../source/discussions/downstream-packaging.rst:305
14381493msgid ""
@@ -1441,6 +1496,9 @@ msgid ""
14411496"minimal smoke testing to comprehensive runs of the complete test suite. "
14421497"There can be various reasons for doing this, for example:"
14431498msgstr ""
1499+ "各类下游项目会对打包后的Python项目进行不同程度的测试。根据具体情况,测试范围"
1500+ "可能从最小化的冒烟测试到完整测试套件的全面执行。进行此类测试可能出于多种原因"
1501+ ",例如:"
14441502
14451503#: ../source/discussions/downstream-packaging.rst:310
14461504msgid "Verifying that the downstream packaging did not introduce any bugs."
0 commit comments