@@ -21,6 +21,15 @@ img.pylogo {
21
21
22
22
<script src =" {{ '/assets/js/check_compatibility_helpers.js' | relative_url }} " ></script >
23
23
<script >
24
+ DB .ANY_VERSION = " any" ;
25
+ DB .INSTALLS_BUT_FAILS_TESTS = " The package installs, but the test suite was not set up for GraalPy." ;
26
+ DB .FAILS_TO_INSTALL = " The package fails to build or install." ;
27
+ DB .UNSUPPORTED = " The package is unsupported." ;
28
+ DB .PERCENT_PASSING = (pct ) => ` ${ pct} % of the tests are passing on GraalPy.` ;
29
+ const PATCH_AVAILABLE = " GraalPy will automatically apply a patch when installing this package to improve compatibility." ;
30
+ const LOWER_PRIORITY = " This version works, but there is no reason to prefer it over more recent versions." ;
31
+ const BUILD_SCRIPT_AVAILABLE = (url ) => ` If you have trouble building this package, there is a <a href='${ url} '>script</a>.`
32
+
24
33
const default_version = ' v242' ;
25
34
const show_percentages = true ;
26
35
const dbs = {};
@@ -39,8 +48,8 @@ img.pylogo {
39
48
for (const item of contents) {
40
49
const parts = item .name .split (' .' );
41
50
const package_name = parts[0 ];
42
- const version = parts .slice (1 , - 1 ).join (' .' ) || " any " ;
43
- packages .push (` ${ package_name} ,${ version} ,0,GraalPy provides a script to build this package from <a href=' ${ item .html_url } '>source</a>. ` );
51
+ const version = parts .slice (1 , - 1 ).join (' .' ) || DB . ANY_VERSION ;
52
+ packages .push (` ${ package_name} ,${ version} ,0,${ BUILD_SCRIPT_AVAILABLE ( item .html_url ) } ` );
44
53
}
45
54
resolve (packages .join (" \n " ));
46
55
} else {
@@ -70,11 +79,11 @@ img.pylogo {
70
79
[currentPatch .name ,
71
80
currentPatch .version ,
72
81
0 ,
73
- currentPatch .comment || " GraalPy automatically applies a patch to run this package. " ].join (" ," )
82
+ currentPatch .comment || PATCH_AVAILABLE ].join (" ," )
74
83
)
75
84
}
76
85
let pkgName = line .substring (2 , line .indexOf (" ." )).trim ();
77
- currentPatch = {name: pkgName, version: " any " };
86
+ currentPatch = {name: pkgName, version: DB . ANY_VERSION };
78
87
} else if (line .startsWith (' #' )) {
79
88
if (! currentPatch .comment ) {
80
89
currentPatch .comment = line .substring (1 ).trim ();
@@ -89,9 +98,9 @@ img.pylogo {
89
98
if (! currentPatch .comment .endsWith (" ." )) {
90
99
currentPatch .comment += " ." ;
91
100
}
92
- currentPatch .comment += " This version works, but another should be chosen if possible. " ;
101
+ currentPatch .comment += " " + LOWER_PRIORITY ;
93
102
} else {
94
- currentPatch .comment = " GraalPy provides a patch for this version, but it is recommended to use another if possible. " ;
103
+ currentPatch .comment = LOWER_PRIORITY ;
95
104
}
96
105
}
97
106
}
@@ -101,7 +110,7 @@ img.pylogo {
101
110
[currentPatch .name ,
102
111
currentPatch .version ,
103
112
0 ,
104
- currentPatch .comment || " GraalPy provides a patch to make this package work. " ].join (" ," )
113
+ currentPatch .comment || PATCH_AVAILABLE ].join (" ," )
105
114
)
106
115
}
107
116
resolve (patches .join (" \n " ));
@@ -287,6 +296,7 @@ img.pylogo {
287
296
</tr>` );
288
297
}
289
298
}
299
+ $ (' #compatibility_page__search-field' ).trigger (" input" );
290
300
updateStatistics (count, countCompatible, countUntested, countIncompatible, countNotSupported);
291
301
updatePagination (true );
292
302
});
@@ -361,14 +371,26 @@ img.pylogo {
361
371
$ (" .compatibility_page-item" ).click (function () {
362
372
$ (this ).addClass (" compatibility_page-active" ).siblings ().removeClass (" compatibility_page-active" );
363
373
const graalpyModuleValue = $ (" .compatibility_page-item.compatibility_page-module.compatibility_page-active" ).attr (" data-filter" );
364
- window .history .pushState (" " , window .location .title , ` ?version=${ graalpyModuleValue} ` );
374
+ let search = window .location .search ;
375
+ if (search) {
376
+ search = search .replace (/ version=[^ &] + / , " " );
377
+ if (search != " ?" ) {
378
+ search += " &" ;
379
+ }
380
+ } else {
381
+ search = " ?" ;
382
+ }
383
+ search += ` version=${ graalpyModuleValue} ` ;
384
+ window .history .pushState (" " , window .location .title , search);
365
385
updatePageData ();
366
386
});
367
387
function setFilters () {
368
388
const params = new URLSearchParams (window .location .search );
369
389
const graalpyModuleValue = params .get (' version' ) || default_version;
370
390
const moduleFilterElement = $ (` .compatibility_page-module[data-filter=${ graalpyModuleValue} ]` );
371
391
moduleFilterElement .addClass (" compatibility_page-active" ).siblings ().removeClass (" compatibility_page-active" );
392
+ const packages = params .get (' packages' ) || " " ;
393
+ $ (' #compatibility_page__search-field' ).val (packages);
372
394
}
373
395
setFilters ();
374
396
});
0 commit comments