Skip to content

Commit 0fd6a4b

Browse files
Merge pull request #162 from pyscript/issue-161
warn instead of error for pinned versions
2 parents 8eee817 + 7c499b0 commit 0fd6a4b

File tree

12 files changed

+96
-4080
lines changed

12 files changed

+96
-4080
lines changed

.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"ecmaVersion": "latest",
99
"sourceType": "module"
1010
},
11-
"ignorePatterns": ["__template.js", "xworker.js", "esm/python/*.js", "esm/3rd-party/*"],
11+
"ignorePatterns": ["__template.js", "xworker.js", "esm/python/*.js", "esm/3rd-party/*", "esm/interpreter/pyodide_graph.js"],
1212
"rules": {
1313
"object-curly-spacing": ["error", "always"],
1414
"quotes": ["error", "single"]

docs/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

esm/interpreter/pyodide.js

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ const type = 'pyodide';
88
const toJsOptions = { dict_converter: Object.fromEntries };
99

1010
const { stringify } = JSON;
11-
const { hasOwn } = Object;
1211

1312
const { apply } = Reflect;
1413
const FunctionPrototype = Function.prototype;
@@ -81,21 +80,17 @@ export default {
8180
if (!index_urls) {
8281
progress('Loading Packages Graph');
8382
const { default: graph } = await import(/* webpackIgnore: true */'./pyodide_graph.js');
84-
progress('Loaded Packages Graph');
85-
if (hasOwn(graph, version)) {
86-
const invalid = packages.filter(entry => {
83+
if (version in graph) {
84+
const current = graph[version];
85+
for (const entry of packages) {
8786
// consider only packages by name but not remote/local ones
88-
if (/^https?:\/\//.test(entry)) return false;
89-
const [name, ...rest] = entry.split(/[>=<]=/);
90-
const known = hasOwn(graph[version], name);
91-
return !known || (rest.length > 0 && rest[0] !== graph[version][name]);
92-
});
93-
if (invalid.length > 0) {
94-
throw new Error(
95-
`These packages are not supported in Pyodide ${version}: ${invalid.join(', ')}`
96-
);
87+
if (/^(?:\.|\/|https?:\/\/)/.test(entry)) continue;
88+
const name = entry.split(/[>=<]=/)[0];
89+
if (name in current) continue;
90+
console.warn(`Pyodide ${version} might not support ${entry}`);
9791
}
9892
}
93+
progress('Loaded Packages Graph');
9994
}
10095
if (config.experimental_remote_packages) {
10196
progress('Loading remote packages');

0 commit comments

Comments
 (0)