You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 2025.10.1/user-guide/configuration/index.html
+12-4Lines changed: 12 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1134,7 +1134,7 @@ <h2 id="file-or-inline">File or inline</h2>
1134
1134
<divclass="language-HTML highlight"><spanclass="filename">Reference a configuration file</span><pre><span></span><code><spanid="__span-2-1"><aid="__codelineno-2-1" name="__codelineno-2-1" href="#__codelineno-2-1"></a><spanclass="p"><</span><spanclass="nt">script</span><spanclass="na">type</span><spanclass="o">=</span><spanclass="s">"py"</span><spanclass="na">src</span><spanclass="o">=</span><spanclass="s">"main.py"</span><spanclass="na">config</span><spanclass="o">=</span><spanclass="s">"pyscript.toml"</span><spanclass="p">></</span><spanclass="nt">script</span><spanclass="p">></span>
1135
1135
</span></code></pre></div>
1136
1136
<p>If you use JSON, you can make it the value of the <code>config</code> attribute:</p>
1137
-
<divclass="language-HTML highlight"><spanclass="filename">JSON as the value of the config attribute.</span><pre><span></span><code><spanid="__span-3-1"><aid="__codelineno-3-1" name="__codelineno-3-1" href="#__codelineno-3-1"></a><spanclass="p"><</span><spanclass="nt">script</span><spanclass="na">type</span><spanclass="o">=</span><spanclass="s">"mpy"</span><spanclass="na">src</span><spanclass="o">=</span><spanclass="s">"main.py"</span><spanclass="na">config</span><spanclass="o">=</span><spanclass="s">'{"packages":["arrr", "numberwang"]}'</span><spanclass="p">></</span><spanclass="nt">script</span><spanclass="p">></span>
1137
+
<divclass="language-HTML highlight"><spanclass="filename">JSON as the value of the config attribute.</span><pre><span></span><code><spanid="__span-3-1"><aid="__codelineno-3-1" name="__codelineno-3-1" href="#__codelineno-3-1"></a><spanclass="p"><</span><spanclass="nt">script</span><spanclass="na">type</span><spanclass="o">=</span><spanclass="s">"py"</span><spanclass="na">src</span><spanclass="o">=</span><spanclass="s">"main.py"</span><spanclass="na">config</span><spanclass="o">=</span><spanclass="s">'{"packages":["arrr", "numberwang"]}'</span><spanclass="p">></</span><spanclass="nt">script</span><spanclass="p">></span>
1138
1138
</span></code></pre></div>
1139
1139
<p>For historical and convenience reasons we still support the inline
1140
1140
specification of configuration information for <code>py</code> and <code>mpy</code> type scripts via a
@@ -1153,6 +1153,14 @@ <h2 id="file-or-inline">File or inline</h2>
1153
1153
with <ahref="../pygame-ce"><code>py-game</code></a> or <ahref="../editor"><code>py-editor</code></a>. For these use the config
1154
1154
attribute method.</p>
1155
1155
</div>
1156
+
<divclass="admonition warning">
1157
+
<pclass="admonition-title">Warning</p>
1158
+
<p>Starting from PyScript 2025.10.1 the config guards against incompatible or not
1159
+
available packages related to the current Pyodide version.</p>
1160
+
<p>There is an ongoing effort to make chosing packages in Pyodide way more helpful
1161
+
than it has ever been but right now be aware if a non existent package for a
1162
+
specific Pyodide version cannot be found an error will be thrown.</p>
1163
+
</div>
1156
1164
<h2id="options">Options</h2>
1157
1165
<p>There are five core options (<ahref="#interpreter"><code>interpreter</code></a>, <ahref="#files"><code>files</code></a>,
1158
1166
<ahref="#packages"><code>packages</code></a>, <ahref="#javascript-modules"><code>js_modules</code></a> and
for the Python interpreter you are configuring, or a fully qualified URL to
1172
1180
a custom version of the interpreter.</p>
1173
1181
<p>The following two examples are equivalent:</p>
1174
-
<divclass="language-TOML highlight"><spanclass="filename">Specify the interpreter version in TOML.</span><pre><span></span><code><spanid="__span-5-1"><aid="__codelineno-5-1" name="__codelineno-5-1" href="#__codelineno-5-1"></a><spanclass="n">interpreter</span><spanclass="w"></span><spanclass="o">=</span><spanclass="w"></span><spanclass="s2">"0.23.4"</span>
1182
+
<divclass="language-TOML highlight"><spanclass="filename">Specify the interpreter version in TOML.</span><pre><span></span><code><spanid="__span-5-1"><aid="__codelineno-5-1" name="__codelineno-5-1" href="#__codelineno-5-1"></a><spanclass="n">interpreter</span><spanclass="w"></span><spanclass="o">=</span><spanclass="w"></span><spanclass="s2">"0.29.0"</span>
1175
1183
</span></code></pre></div>
1176
1184
<divclass="language-JSON highlight"><spanclass="filename">Specify the interpreter version in JSON.</span><pre><span></span><code><spanid="__span-6-1"><aid="__codelineno-6-1" name="__codelineno-6-1" href="#__codelineno-6-1"></a><spanclass="p">{</span>
<p>The following JSON fragment uses a fully qualified URL to point to the same
1181
1189
version of Pyodide as specified in the previous examples:</p>
1182
1190
<divclass="language-JSON highlight"><spanclass="filename">Specify the interpreter via a fully qualified URL.</span><pre><span></span><code><spanid="__span-7-1"><aid="__codelineno-7-1" name="__codelineno-7-1" href="#__codelineno-7-1"></a><spanclass="p">{</span>
0 commit comments