@@ -8,7 +8,6 @@ const type = 'pyodide';
88const toJsOptions = { dict_converter : Object . fromEntries } ;
99
1010const { stringify } = JSON ;
11- const { hasOwn } = Object ;
1211
1312const { apply } = Reflect ;
1413const FunctionPrototype = Function . prototype ;
@@ -79,23 +78,19 @@ export default {
7978 if ( packages ) {
8079 packages = packages . map ( fixedRelative , baseURL ) ;
8180 if ( ! index_urls ) {
82- progress ( 'Loading Packages Graph' ) ;
81+ progress ( 'Checking 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 packages = graph [ version ] ;
85+ for ( const entry of packages ) {
8786 // consider only packages by name but not remote/local ones
88- if ( / ^ h t t p s ? : \/ \/ / . 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 ( / ^ (?: \. | \/ | h t t p s ? : \/ \/ ) / . test ( entry ) ) continue ;
88+ const name = entry . split ( / [ > = < ] = / ) [ 0 ] ;
89+ if ( name in packages ) continue ;
90+ console . warn ( `Pyodide ${ version } might not support ${ entry } ` ) ;
9791 }
9892 }
93+ progress ( 'Checked Packages Graph' ) ;
9994 }
10095 if ( config . experimental_remote_packages ) {
10196 progress ( 'Loading remote packages' ) ;
0 commit comments