@@ -10,7 +10,95 @@ permalink: compatibility/
10
10
const dbs = {};
11
11
var module_query = ' ' ;
12
12
const load_db = function (graalpyVersion ) {
13
- return new Promise (function (resolve , reject ) {
13
+ var graalvmVersion = graalpyVersion .replace (/ ^ v/ , " " ).replace (/ ^ (\d\d )/ , " $1." );
14
+ var wheelbuilder_scripts = new Promise (function (resolve , reject ) {
15
+ const xhr = new XMLHttpRequest ();
16
+ const url = ` https://api.github.com/repos/oracle/graalpython/contents/scripts/wheelbuilder/linux?ref=release/graal-vm/${ graalvmVersion} ` ;
17
+ xhr .open (' GET' , url);
18
+ xhr .overrideMimeType (' text/plain' );
19
+ xhr .onload = function () {
20
+ if (this .status === 200 ) {
21
+ const contents = JSON .parse (this .responseText );
22
+ const packages = [];
23
+ for (const item of contents) {
24
+ const parts = item .name .split (' .' );
25
+ const package_name = parts[0 ];
26
+ const version = parts .slice (1 , - 1 ).join (' .' ) || " any" ;
27
+ packages .push (` ${ package_name} ,${ version} ,0,GraalPy provides a script to build this package from <a href='${ item .html_url } '>source</a>.` );
28
+ }
29
+ resolve (packages .join (" \n " ));
30
+ } else {
31
+ reject (this .statusText );
32
+ }
33
+ };
34
+ xhr .onerror = function () {
35
+ reject (url);
36
+ };
37
+ xhr .send ();
38
+ });
39
+ var patch_metadata = new Promise (function (resolve , reject ) {
40
+ const xhr = new XMLHttpRequest ();
41
+ const url = ` https://raw.githubusercontent.com/oracle/graalpython/refs/heads/release/graal-vm/${ graalvmVersion} /graalpython/lib-graalpython/patches/metadata.toml` ;
42
+ xhr .open (' GET' , url);
43
+ xhr .overrideMimeType (' text/plain' );
44
+ xhr .onload = function () {
45
+ if (this .status === 200 ) {
46
+ const patches = [];
47
+ const lines = this .responseText .trim ().split (' \n ' );
48
+ var currentPatch = null ;
49
+ for (let i = 0 ; i < lines .length ; i++ ) {
50
+ const line = lines[i].trim ();
51
+ if (line .startsWith (' [[' )) {
52
+ if (currentPatch != null ) {
53
+ patches .push (
54
+ [currentPatch .name ,
55
+ currentPatch .version ,
56
+ 0 ,
57
+ currentPatch .comment || " GraalPy automatically applies a patch to run this package." ].join (" ," )
58
+ )
59
+ }
60
+ let pkgName = line .substring (2 , line .indexOf (" ." )).trim ();
61
+ currentPatch = {name: pkgName, version: " any" };
62
+ } else if (line .startsWith (' #' )) {
63
+ if (! currentPatch .comment ) {
64
+ currentPatch .comment = line .substring (1 ).trim ();
65
+ } else {
66
+ currentPatch .comment += ' ' + line .substring (1 ).trim ();
67
+ }
68
+ } else if (line .startsWith (' version =' )) {
69
+ currentPatch .version = line .substring (' version =' .length ).trim ().replace (/ '| "/ g , ' ' ).replace (/ ^ == ? / , " " ).replace (/ , ? / g , " and " );
70
+ } else if (line .startsWith (' install-priority =' )) {
71
+ if (parseInt (line .substring (' install-priority =' .length ).trim (), 10 ) <= 0 ) {
72
+ if (currentPatch .comment ) {
73
+ if (! currentPatch .comment .endsWith (" ." )) {
74
+ currentPatch .comment += " ." ;
75
+ }
76
+ currentPatch .comment += " This version works, but another should be chosen if possible." ;
77
+ } else {
78
+ currentPatch .comment = " GraalPy provides a patch for this version, but it is recommended to use another if possible." ;
79
+ }
80
+ }
81
+ }
82
+ }
83
+ if (currentPatch != null ) {
84
+ patches .push (
85
+ [currentPatch .name ,
86
+ currentPatch .version ,
87
+ 0 ,
88
+ currentPatch .comment || " GraalPy provides a patch to make this package work." ].join (" ," )
89
+ )
90
+ }
91
+ resolve (patches .join (" \n " ));
92
+ } else {
93
+ reject (this .statusText );
94
+ }
95
+ };
96
+ xhr .onerror = function () {
97
+ reject (url);
98
+ };
99
+ xhr .send ();
100
+ });
101
+ var module_testing_csv = new Promise (function (resolve , reject ) {
14
102
const xhr = new XMLHttpRequest ();
15
103
const url = ` /python/module_results/python-module-testing-${ graalpyVersion} .csv` ;
16
104
xhr .open (' GET' , url);
@@ -27,6 +115,36 @@ permalink: compatibility/
27
115
};
28
116
xhr .send ();
29
117
});
118
+ var wheels_csv = new Promise (function (resolve , reject ) {
119
+ const xhr = new XMLHttpRequest ();
120
+ const url = ` /python/wheels/${ graalpyVersion} .csv` ;
121
+ xhr .open (' GET' , url);
122
+ xhr .overrideMimeType (' text/plain' );
123
+ xhr .onload = function () {
124
+ if (this .status === 200 ) {
125
+ resolve (this .responseText );
126
+ } else {
127
+ reject (this .statusText );
128
+ }
129
+ };
130
+ xhr .onerror = function () {
131
+ reject (url);
132
+ };
133
+ xhr .send ();
134
+ });
135
+ return new Promise (function (resolve , reject ) {
136
+ Promise .allSettled ([module_testing_csv, patch_metadata, wheelbuilder_scripts, wheels_csv]).then (function (results ) {
137
+ resolve (results .map (function (result ) {
138
+ if (result .status === ' fulfilled' ) {
139
+ return result .value ;
140
+ } else {
141
+ return null ;
142
+ }
143
+ }).filter ((entry ) => !! entry).join (" \n " ));
144
+ }).catch (function (err ) {
145
+ reject (err);
146
+ });
147
+ });
30
148
};
31
149
let pageNumber = 0 ;
32
150
let database;
@@ -115,8 +233,15 @@ permalink: compatibility/
115
233
let countNotSupported = 0 ;
116
234
$ (' #dataTable tbody' ).empty ();
117
235
for (let package in database .db ) {
118
- const versions = database .db [package ]
119
- versions_loop: for (let version in versions) {
236
+ const versions = database .db [package ];
237
+ const version_keys = Object .keys (versions).sort ((a , b ) => {
238
+ const versionA = a .replace (/ [~><=! ] / g , ' ' );
239
+ const versionB = b .replace (/ [~><=! ] / g , ' ' );
240
+ if (versionA < versionB) return - 1 ;
241
+ if (versionA > versionB) return 1 ;
242
+ return 0 ;
243
+ });
244
+ versions_loop: for (const version of version_keys) {
120
245
if (version .startsWith (' ~' )) {
121
246
continue ;
122
247
}
@@ -135,16 +260,14 @@ permalink: compatibility/
135
260
countNotSupported++ ;
136
261
break ;
137
262
default :
138
- console .log (` Unknown test_status: ${ info .test_status } for package ${ info .name } ` );
139
263
continue versions_loop;
140
264
}
141
265
const styling = count++ < rowsPerPage ? ' ' : ' style="display: none;"' ;
142
266
$ (' #dataTable tbody' ).append (`
143
267
<tr${ styling} >
144
268
<td class="dataTable-name">${ info .name } </td>
145
269
<td>${ info .version } </td>
146
- <td>${ info .pass_percentage } </td>
147
- <td><a href="https://pypi.org/project/${ info .name } /" target="_blank">${ info .name } on pypi.org</td>
270
+ <td>${ info .notes } </td>
148
271
</tr>` );
149
272
}
150
273
}
@@ -271,9 +394,13 @@ You can extend it with Python code or leverage packages from the Python ecosyste
271
394
<div class="wrapper">
272
395
<div class="compatibility">
273
396
<div class="container">
274
- <h5 class="compatibility-text">To ensure GraalPy is compatible with common Python packages, the GraalPy team conducts
275
- compatibility testing to verify the presence and correct functioning of
276
- the top 500 packages on PyPI plus some more that are of special interest to us, including
397
+ <h5 class="compatibility-text">Python PackagesGraalPy is compatible with many packages, including packages like
398
+ PyTorch, NumPy, Huggingface Transformers and many more that are used for Data Science and
399
+ Machine Learning. If you want to try a package, first just pick any version and only if you
400
+ run into problems, consult the table below to see if there is a version that may work better.</h5>
401
+ <h5 class="compatibility-text">To ensure GraalPy is compatible with common Python packages,
402
+ the GraalPy team conducts compatibility testing and creates scripts to build and patch many
403
+ of the top packages on PyPI plus some more that are of special interest to us, including
277
404
libraries and frameworks such as NumPy, Pandas, and Django.</h5>
278
405
<h5 class="compatibility-text">Compatibility testing ensures that
279
406
developers can leverage GraalPy's powerful capabilities in their existing applications.
@@ -282,7 +409,7 @@ You can extend it with Python code or leverage packages from the Python ecosyste
282
409
toolsets.</h5>
283
410
<h5 class="compatibility-text">Many more Python packages than are on this list work on GraalPy.
284
411
If there is a package you are interested in that you cannot find here, chances are that it
285
- might just work.</h5>
412
+ might just work. If it does not, please reach out to us on [Github](https://github.com/oracle/graalpython/issues) </h5>
286
413
</div>
287
414
</div>
288
415
</div>
@@ -326,7 +453,7 @@ You can extend it with Python code or leverage packages from the Python ecosyste
326
453
<div class="wrapper">
327
454
<div class="compatibility">
328
455
<div class="container">
329
- <h3 class="pypage__title -02">Python Packages</h3>
456
+ <h3 class="langpage__title -02">Python Packages</h3>
330
457
<div class="package__row">
331
458
<div class="package__search">
332
459
<input type="text" id="compatibility_page__search-field" placeholder="Comma-separated list of packages">
@@ -338,10 +465,6 @@ You can extend it with Python code or leverage packages from the Python ecosyste
338
465
</label>
339
466
<input type="file" id="add-requirements-btn" accept=".txt">
340
467
</div>
341
- <div>
342
- <a href="{{ '/module_results/python-module-testing-v231.csv' | relative_url }}"
343
- target="_blank"><button class="download-data-btn">Download data</button></a>
344
- </div>
345
468
</div>
346
469
</div>
347
470
<div class="compattable-container">
@@ -351,8 +474,7 @@ You can extend it with Python code or leverage packages from the Python ecosyste
351
474
<tr class="add-radius">
352
475
<th scope="col" title="Name">Name</th>
353
476
<th scope="col" title="Version">Version</th>
354
- <th scope="col" title="Test Level">Test Level %</th>
355
- <th scope="col" title="Package URL">Package URL</th>
477
+ <th scope="col" title="Notes">Notes</th>
356
478
</tr>
357
479
</thead>
358
480
<tbody></tbody>
0 commit comments