|
8 | 8 | msgstr "" |
9 | 9 | "Project-Id-Version: Python Packaging User Guide \n" |
10 | 10 | "Report-Msgid-Bugs-To: \n" |
11 | | -"POT-Creation-Date: 2024-05-07 08:04+0000\n" |
| 11 | +"POT-Creation-Date: 2024-05-08 15:02+0000\n" |
12 | 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
13 | 13 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
14 | 14 | "Language-Team: LANGUAGE < [email protected]>\n" |
@@ -8228,7 +8228,7 @@ msgstr "" |
8228 | 8228 | #: ../source/specifications/direct-url.rst:67 |
8229 | 8229 | #: ../source/specifications/entry-points.rst:164 |
8230 | 8230 | #: ../source/specifications/externally-managed-environments.rst:472 |
8231 | | -#: ../source/specifications/inline-script-metadata.rst:211 |
| 8231 | +#: ../source/specifications/inline-script-metadata.rst:213 |
8232 | 8232 | #: ../source/specifications/name-normalization.rst:50 |
8233 | 8233 | #: ../source/specifications/platform-compatibility-tags.rst:332 |
8234 | 8234 | #: ../source/specifications/pyproject-toml.rst:443 |
@@ -8933,7 +8933,7 @@ msgstr "" |
8933 | 8933 | #: ../source/specifications/dependency-specifiers.rst:26 |
8934 | 8934 | #: ../source/specifications/direct-url-data-structure.rst:19 |
8935 | 8935 | #: ../source/specifications/direct-url.rst:15 |
8936 | | -#: ../source/specifications/inline-script-metadata.rst:11 |
| 8936 | +#: ../source/specifications/inline-script-metadata.rst:13 |
8937 | 8937 | msgid "Specification" |
8938 | 8938 | msgstr "" |
8939 | 8939 |
|
@@ -10067,128 +10067,128 @@ msgstr "" |
10067 | 10067 | msgid "This is a list of currently active interoperability specifications maintained by the Python Packaging Authority. The process for updating these standards, and for proposing new ones, is documented on `pypa.io <https://www.pypa.io/en/latest/specifications/>`__." |
10068 | 10068 | msgstr "" |
10069 | 10069 |
|
10070 | | -#: ../source/specifications/inline-script-metadata.rst:3 |
| 10070 | +#: ../source/specifications/inline-script-metadata.rst:5 |
10071 | 10071 | msgid "Inline script metadata" |
10072 | 10072 | msgstr "" |
10073 | 10073 |
|
10074 | | -#: ../source/specifications/inline-script-metadata.rst:5 |
| 10074 | +#: ../source/specifications/inline-script-metadata.rst:7 |
10075 | 10075 | msgid "This specification defines a metadata format that can be embedded in single-file Python scripts to assist launchers, IDEs and other external tools which may need to interact with such scripts." |
10076 | 10076 | msgstr "" |
10077 | 10077 |
|
10078 | | -#: ../source/specifications/inline-script-metadata.rst:13 |
| 10078 | +#: ../source/specifications/inline-script-metadata.rst:15 |
10079 | 10079 | msgid "This specification defines a metadata comment block format (loosely inspired by `reStructuredText Directives`__)." |
10080 | 10080 | msgstr "" |
10081 | 10081 |
|
10082 | | -#: ../source/specifications/inline-script-metadata.rst:18 |
| 10082 | +#: ../source/specifications/inline-script-metadata.rst:20 |
10083 | 10083 | msgid "Any Python script may have top-level comment blocks that MUST start with the line ``# /// TYPE`` where ``TYPE`` determines how to process the content. That is: a single ``#``, followed by a single space, followed by three forward slashes, followed by a single space, followed by the type of metadata. Block MUST end with the line ``# ///``. That is: a single ``#``, followed by a single space, followed by three forward slashes. The ``TYPE`` MUST only consist of ASCII letters, numbers and hyphens." |
10084 | 10084 | msgstr "" |
10085 | 10085 |
|
10086 | | -#: ../source/specifications/inline-script-metadata.rst:26 |
| 10086 | +#: ../source/specifications/inline-script-metadata.rst:28 |
10087 | 10087 | msgid "Every line between these two lines (``# /// TYPE`` and ``# ///``) MUST be a comment starting with ``#``. If there are characters after the ``#`` then the first character MUST be a space. The embedded content is formed by taking away the first two characters of each line if the second character is a space, otherwise just the first character (which means the line consists of only a single ``#``)." |
10088 | 10088 | msgstr "" |
10089 | 10089 |
|
10090 | | -#: ../source/specifications/inline-script-metadata.rst:33 |
| 10090 | +#: ../source/specifications/inline-script-metadata.rst:35 |
10091 | 10091 | msgid "Precedence for an ending line ``# ///`` is given when the next line is not a valid embedded content line as described above. For example, the following is a single fully valid block:" |
10092 | 10092 | msgstr "" |
10093 | 10093 |
|
10094 | | -#: ../source/specifications/inline-script-metadata.rst:49 |
| 10094 | +#: ../source/specifications/inline-script-metadata.rst:51 |
10095 | 10095 | msgid "A starting line MUST NOT be placed between another starting line and its ending line. In such cases tools MAY produce an error. Unclosed blocks MUST be ignored." |
10096 | 10096 | msgstr "" |
10097 | 10097 |
|
10098 | | -#: ../source/specifications/inline-script-metadata.rst:52 |
| 10098 | +#: ../source/specifications/inline-script-metadata.rst:54 |
10099 | 10099 | msgid "When there are multiple comment blocks of the same ``TYPE`` defined, tools MUST produce an error." |
10100 | 10100 | msgstr "" |
10101 | 10101 |
|
10102 | | -#: ../source/specifications/inline-script-metadata.rst:55 |
| 10102 | +#: ../source/specifications/inline-script-metadata.rst:57 |
10103 | 10103 | msgid "Tools reading embedded metadata MAY respect the standard Python encoding declaration. If they choose not to do so, they MUST process the file as UTF-8." |
10104 | 10104 | msgstr "" |
10105 | 10105 |
|
10106 | | -#: ../source/specifications/inline-script-metadata.rst:58 |
| 10106 | +#: ../source/specifications/inline-script-metadata.rst:60 |
10107 | 10107 | msgid "This is the canonical regular expression that MAY be used to parse the metadata:" |
10108 | 10108 | msgstr "" |
10109 | 10109 |
|
10110 | | -#: ../source/specifications/inline-script-metadata.rst:65 |
| 10110 | +#: ../source/specifications/inline-script-metadata.rst:67 |
10111 | 10111 | msgid "In circumstances where there is a discrepancy between the text specification and the regular expression, the text specification takes precedence." |
10112 | 10112 | msgstr "" |
10113 | 10113 |
|
10114 | | -#: ../source/specifications/inline-script-metadata.rst:68 |
| 10114 | +#: ../source/specifications/inline-script-metadata.rst:70 |
10115 | 10115 | msgid "Tools MUST NOT read from metadata blocks with types that have not been standardized by this specification." |
10116 | 10116 | msgstr "" |
10117 | 10117 |
|
10118 | | -#: ../source/specifications/inline-script-metadata.rst:72 |
| 10118 | +#: ../source/specifications/inline-script-metadata.rst:74 |
10119 | 10119 | msgid "script type" |
10120 | 10120 | msgstr "" |
10121 | 10121 |
|
10122 | | -#: ../source/specifications/inline-script-metadata.rst:74 |
| 10122 | +#: ../source/specifications/inline-script-metadata.rst:76 |
10123 | 10123 | msgid "The first type of metadata block is named ``script``, which contains script metadata (dependency data and tool configuration)." |
10124 | 10124 | msgstr "" |
10125 | 10125 |
|
10126 | | -#: ../source/specifications/inline-script-metadata.rst:77 |
| 10126 | +#: ../source/specifications/inline-script-metadata.rst:79 |
10127 | 10127 | msgid "This document MAY include the top-level fields ``dependencies`` and ``requires-python``, and MAY optionally include a ``[tool]`` table." |
10128 | 10128 | msgstr "" |
10129 | 10129 |
|
10130 | | -#: ../source/specifications/inline-script-metadata.rst:80 |
| 10130 | +#: ../source/specifications/inline-script-metadata.rst:82 |
10131 | 10131 | msgid "The ``[tool]`` MAY be used by any tool, script runner or otherwise, to configure behavior. It has the same semantics as the :ref:`[tool] table in pyproject.toml <pyproject-tool-table>`." |
10132 | 10132 | msgstr "" |
10133 | 10133 |
|
10134 | | -#: ../source/specifications/inline-script-metadata.rst:84 |
| 10134 | +#: ../source/specifications/inline-script-metadata.rst:86 |
10135 | 10135 | msgid "The top-level fields are:" |
10136 | 10136 | msgstr "" |
10137 | 10137 |
|
10138 | | -#: ../source/specifications/inline-script-metadata.rst:86 |
| 10138 | +#: ../source/specifications/inline-script-metadata.rst:88 |
10139 | 10139 | msgid "``dependencies``: A list of strings that specifies the runtime dependencies of the script. Each entry MUST be a valid :ref:`dependency specifier <dependency-specifiers>`." |
10140 | 10140 | msgstr "" |
10141 | 10141 |
|
10142 | | -#: ../source/specifications/inline-script-metadata.rst:89 |
| 10142 | +#: ../source/specifications/inline-script-metadata.rst:91 |
10143 | 10143 | msgid "``requires-python``: A string that specifies the Python version(s) with which the script is compatible. The value of this field MUST be a valid :ref:`version specifier <version-specifiers>`." |
10144 | 10144 | msgstr "" |
10145 | 10145 |
|
10146 | | -#: ../source/specifications/inline-script-metadata.rst:93 |
| 10146 | +#: ../source/specifications/inline-script-metadata.rst:95 |
10147 | 10147 | msgid "Script runners MUST error if the specified ``dependencies`` cannot be provided. Script runners SHOULD error if no version of Python that satisfies the specified ``requires-python`` can be provided." |
10148 | 10148 | msgstr "" |
10149 | 10149 |
|
10150 | | -#: ../source/specifications/inline-script-metadata.rst:98 |
| 10150 | +#: ../source/specifications/inline-script-metadata.rst:100 |
10151 | 10151 | msgid "Example" |
10152 | 10152 | msgstr "" |
10153 | 10153 |
|
10154 | | -#: ../source/specifications/inline-script-metadata.rst:100 |
| 10154 | +#: ../source/specifications/inline-script-metadata.rst:102 |
10155 | 10155 | msgid "The following is an example of a script with embedded metadata:" |
10156 | 10156 | msgstr "" |
10157 | 10157 |
|
10158 | | -#: ../source/specifications/inline-script-metadata.rst:121 |
| 10158 | +#: ../source/specifications/inline-script-metadata.rst:123 |
10159 | 10159 | msgid "Reference Implementation" |
10160 | 10160 | msgstr "" |
10161 | 10161 |
|
10162 | | -#: ../source/specifications/inline-script-metadata.rst:123 |
| 10162 | +#: ../source/specifications/inline-script-metadata.rst:125 |
10163 | 10163 | msgid "The following is an example of how to read the metadata on Python 3.11 or higher." |
10164 | 10164 | msgstr "" |
10165 | 10165 |
|
10166 | | -#: ../source/specifications/inline-script-metadata.rst:149 |
| 10166 | +#: ../source/specifications/inline-script-metadata.rst:151 |
10167 | 10167 | msgid "Often tools will edit dependencies like package managers or dependency update automation in CI. The following is a crude example of modifying the content using the ``tomlkit`` library__." |
10168 | 10168 | msgstr "" |
10169 | 10169 |
|
10170 | | -#: ../source/specifications/inline-script-metadata.rst:180 |
| 10170 | +#: ../source/specifications/inline-script-metadata.rst:182 |
10171 | 10171 | msgid "Note that this example used a library that preserves TOML formatting. This is not a requirement for editing by any means but rather is a \"nice to have\" feature." |
10172 | 10172 | msgstr "" |
10173 | 10173 |
|
10174 | | -#: ../source/specifications/inline-script-metadata.rst:184 |
| 10174 | +#: ../source/specifications/inline-script-metadata.rst:186 |
10175 | 10175 | msgid "The following is an example of how to read a stream of arbitrary metadata blocks." |
10176 | 10176 | msgstr "" |
10177 | 10177 |
|
10178 | | -#: ../source/specifications/inline-script-metadata.rst:203 |
| 10178 | +#: ../source/specifications/inline-script-metadata.rst:205 |
10179 | 10179 | #: ../source/specifications/simple-repository-api.rst:815 |
10180 | 10180 | msgid "Recommendations" |
10181 | 10181 | msgstr "" |
10182 | 10182 |
|
10183 | | -#: ../source/specifications/inline-script-metadata.rst:205 |
| 10183 | +#: ../source/specifications/inline-script-metadata.rst:207 |
10184 | 10184 | msgid "Tools that support managing different versions of Python should attempt to use the highest available version of Python that is compatible with the script's ``requires-python`` metadata, if defined." |
10185 | 10185 | msgstr "" |
10186 | 10186 |
|
10187 | | -#: ../source/specifications/inline-script-metadata.rst:213 |
| 10187 | +#: ../source/specifications/inline-script-metadata.rst:215 |
10188 | 10188 | msgid "October 2023: This specification was conditionally approved through :pep:`723`." |
10189 | 10189 | msgstr "" |
10190 | 10190 |
|
10191 | | -#: ../source/specifications/inline-script-metadata.rst:214 |
| 10191 | +#: ../source/specifications/inline-script-metadata.rst:216 |
10192 | 10192 | msgid "January 2024: Through amendments to :pep:`723`, the ``pyproject`` metadata block type was renamed to ``script``, and the ``[run]`` table was dropped, making the ``dependencies`` and ``requires-python`` keys top-level. Additionally, the specification is no longer provisional." |
10193 | 10193 | msgstr "" |
10194 | 10194 |
|
|
0 commit comments