Skip to content

Latest commit

 

History

History
626 lines (610 loc) · 28.2 KB

File metadata and controls

626 lines (610 loc) · 28.2 KB
layout base
permalink python-developers/compatibility/
audience_identifier python
title Compatibility
<style> img.pylogo { width: 56px; height: 56px; } .langbenefits__icon_pylogo { width: 80px; } .dataTable-version { min-width: 120px; } .highlight-package::before { float: right; border-radius: 50%; margin-top: 0.5ex; width: 15px; height: 15px; display: inline-block; margin-right: 5px; } .legend-item-1::before { font-size: 12px; font-weight: bold; text-align: center; content: "✓"; } .legend-item-2::before { font-size: 12px; font-weight: bold; text-align: center; content: "?"; } .legend-item-3::before { font-size: 12px; font-weight: bold; text-align: center; content: "✗"; } #compatibility-stats-compatible, #compatibility-stats-untested, #compatibility-stats-incompatible, #compatibility-stats-not-supported { padding-left: 0.5em; } </style> <script src="{{ '/assets/js/check_compatibility_helpers.js' | relative_url }}"></script> <script> DB.ANY_VERSION = "any"; DB.INSTALLS_BUT_FAILS_TESTS = "The package installs, but the test suite was not set up for GraalPy."; DB.FAILS_TO_INSTALL = "We have been unable to build, install, or run tests for this package."; DB.UNSUPPORTED = "The package is unsupported."; DB.PERCENT_PASSING = (pct) => `${pct}% of the tests are passing on GraalPy.`; const PATCH_AVAILABLE = "GraalPy will automatically apply a patch when installing this package to improve compatibility."; const LOWER_PRIORITY = "This version works, but there is no reason to prefer it over more recent versions."; const BUILD_SCRIPT_AVAILABLE = (url) => `If you have trouble building this package, there is a script.` const default_version = 'v250'; const show_percentages = true; const dbs = {}; var module_query = ''; const load_db = function (graalpyVersion) { var graalvmVersion = graalpyVersion.replace(/^v/, "").replace(/^(\d\d)/, "$1."); var wheelbuilder_scripts = new Promise(function (resolve, reject) { const xhr = new XMLHttpRequest(); const url = `https://api.github.com/repos/oracle/graalpython/contents/scripts/wheelbuilder/linux?ref=release/graal-vm/${graalvmVersion}`; xhr.open('GET', url); xhr.overrideMimeType('text/plain'); xhr.onload = function () { if (this.status === 200) { const contents = JSON.parse(this.responseText); const packages = []; for (const item of contents) { const parts = item.name.split('.'); const package_name = parts[0]; const version = parts.slice(1, -1).join('.') || DB.ANY_VERSION; packages.push(`${package_name},${version},0,${BUILD_SCRIPT_AVAILABLE(item.html_url)}`); } resolve(packages.join("\n")); } else { reject(this.statusText); } }; xhr.onerror = function () { reject(url); }; xhr.send(); }); var patch_metadata = new Promise(function (resolve, reject) { const xhr = new XMLHttpRequest(); const url = `https://raw.githubusercontent.com/oracle/graalpython/refs/heads/release/graal-vm/${graalvmVersion}/graalpython/lib-graalpython/patches/metadata.toml`; xhr.open('GET', url); xhr.overrideMimeType('text/plain'); xhr.onload = function () { if (this.status === 200) { const patches = []; const lines = this.responseText.split('\n'); var currentPatch = null; for (let i = 0; i < lines.length; i++) { const line = lines[i].trim(); if (line.startsWith('[[')) { if (currentPatch != null) { patches.push( [currentPatch.name, currentPatch.version, 0, currentPatch.comment || PATCH_AVAILABLE].join(",") ) } let pkgName = line.substring(2, line.indexOf(".")).trim(); currentPatch = {name: pkgName, version: DB.ANY_VERSION}; } else if (line.startsWith('note =')) { currentPatch.comment = line.substring('note ='.length).trim(); } else if (line.startsWith('version =')) { currentPatch.version = line.substring('version ='.length).trim().replace(/'|"/g, '').replace(/^== ?/, "").replace(/, ?/g, " and "); } else if (line.startsWith('install-priority =')) { if (parseInt(line.substring('install-priority ='.length).trim(), 10) <= 0) { if (currentPatch.comment) { if (!currentPatch.comment.endsWith(".")) { currentPatch.comment += "."; } currentPatch.comment += " " + LOWER_PRIORITY; } else { currentPatch.comment = LOWER_PRIORITY; } } } } if (currentPatch != null) { patches.push( [currentPatch.name, currentPatch.version, 0, currentPatch.comment || PATCH_AVAILABLE].join(",") ) } resolve(patches.join("\n")); } else { reject(this.statusText); } }; xhr.onerror = function () { reject(url); }; xhr.send(); }); var module_testing_csv = new Promise(function (resolve, reject) { const xhr = new XMLHttpRequest(); const url = `{{ '/module_results/' | relative_url }}python-module-testing-${graalpyVersion}.csv`; xhr.open('GET', url); xhr.overrideMimeType('text/plain'); xhr.onload = function () { if (this.status === 200) { resolve(this.responseText); } else { reject(this.statusText); } }; xhr.onerror = function () { reject(url); }; xhr.send(); }); var wheels_csv = new Promise(function (resolve, reject) { const xhr = new XMLHttpRequest(); const url = `{{ '/wheels/' | relative_url }}${graalpyVersion}.csv`; xhr.open('GET', url); xhr.overrideMimeType('text/plain'); xhr.onload = function () { if (this.status === 200) { resolve(this.responseText); } else { reject(this.statusText); } }; xhr.onerror = function () { reject(url); }; xhr.send(); }); return new Promise(function (resolve, reject) { Promise.allSettled([module_testing_csv, patch_metadata, wheelbuilder_scripts, wheels_csv]).then(function (results) { resolve(results.map(function (result) { if (result.status === 'fulfilled') { return result.value; } else { return null; } }).filter((entry) => !!entry).join("\n")); }).catch(function (err) { reject(err); }); }); }; let pageNumber = 0; let database; const getRowsPerPage = function () { return parseInt($('#rowsPerPage').val()); } const updatePagination = function (reset) { if (reset) { pageNumber = 0; } $('#pagination-previous').attr('disabled', pageNumber == 0); const rowsPerPage = getRowsPerPage(); const count = $('#dataTable tbody tr:not(.dataTable-filtered-out)').length; let pageText; if (count < rowsPerPage) { pageText = `1-${count}`; pageNumber = 0; } else { const start = pageNumber * rowsPerPage; const end = start + rowsPerPage; $('#pagination-next').attr('disabled', end >= count); pageText = `${start}-${Math.min(end, count)}` if (!reset) { let numberOfRowsToSkip = start let numberOfVisibleRows = 0; const rows = $('#dataTable tbody tr'); rows.each(function () { if (!$(this).hasClass('dataTable-filtered-out')) { if (numberOfRowsToSkip > 0) { $(this).hide(); numberOfRowsToSkip--; } else { if (numberOfVisibleRows < rowsPerPage) { $(this).show(); numberOfVisibleRows++; } else { $(this).hide(); } } } }); } } $('#pagination-label').text(`${pageText} of ${count}`) } const toStatisticsText = function (part, total) { return `${part} (${Math.round(part / total * 100 * 100) / 100}%)` } const updateStatistics = function (count, countCompatible, countUntested, countIncompatible, countNotSupported) { var offset = 0; var svg = ` `; const drawOne = function(name, size, color) { svg += ` <title>${name}: ${toStatisticsText(size, count)}</title> `; offset += size; } drawOne('Compatible', countCompatible, '#13A97C'); drawOne('Untested', countUntested, '#76D1FF'); drawOne('Incompatible', countIncompatible, '#C84D4D'); drawOne('Unsupported', countNotSupported, '#D7D7D7'); svg += ``; var chart = document.getElementById('pie-chart'); chart.innerHTML = svg; $('#compatibility-stats-compatible').text(toStatisticsText(countCompatible, count)); $('#compatibility-stats-untested').text(toStatisticsText(countUntested, count)); $('#compatibility-stats-incompatible').text(toStatisticsText(countIncompatible, count)); $('#compatibility-stats-not-supported').text(toStatisticsText(countNotSupported, count)); } const updatePageData = function () { const params = new URLSearchParams(window.location.search); const graalpyModuleValue = params.get('version') || default_version; load_db(graalpyModuleValue).then(function (db_contents) { database = new DB("python", db_contents); const rowsPerPage = getRowsPerPage(); let count = 0; let countCompatible = 0; let countUntested = 0; let countIncompatible = 0; let countNotSupported = 0; $('#dataTable tbody').empty(); for (let package in database.db) { const versions = database.db[package]; const version_keys = Object.keys(versions).sort((a, b) => { const versionA = a.replace(/[~><=! ]/g, ''); const versionB = b.replace(/[~><=! ]/g, ''); if (versionA < versionB) return -1; if (versionA > versionB) return 1; return 0; }); versions_loop: for (const version of version_keys) { if (version.startsWith('~')) { continue; } const info = versions[version]; switch (info.test_status) { case 0: countCompatible++; break; case 1: countUntested++; break; case 2: countIncompatible++; break; case 3: countNotSupported++; break; default: continue versions_loop; } const styling = count++ < rowsPerPage ? '' : ' style="display: none;"'; const highlight = ''.repeat(Math.ceil(info.highlight)); $('#dataTable tbody').append(` ${info.name} ${info.version}${highlight} ${info.notes} `); } } $('#compatibility_page__search-field').trigger("input"); updateStatistics(count, countCompatible, countUntested, countIncompatible, countNotSupported); updatePagination(true); }); } $(document).ready(function () { updatePageData(); $('#compatibility_page__search-field').on('input', function () { const searchTerms = this.value.split(','); let numberOfVisibleRows = 0; const rowsPerPage = getRowsPerPage(); const rows = $('#dataTable tbody tr'); rows.each(function () { if (searchTerms.some(term => (searchTerms.length <= 1 || term !== '') && $(this).find('.dataTable-name').first().text().includes(term))) { $(this).removeClass('dataTable-filtered-out'); if (numberOfVisibleRows < rowsPerPage) { $(this).show(); numberOfVisibleRows++; } else { $(this).hide(); } } else { $(this).addClass('dataTable-filtered-out'); $(this).hide(); } }); updatePagination(true); }); $('#add-requirements-btn').on('change', function (e) { e.stopPropagation(); e.preventDefault(); const file = this.files[0]; const fileReader = new FileReader(); fileReader.onloadend = function (e) { const contents = e.target.result; const searchTerms = []; for (const line of contents.split('\n')) { const trimmedLine = line.trim(); const pythonPackageName = trimmedLine.match(/^[a-zA-Z0-9]+/); if (pythonPackageName !== null) { searchTerms.push(pythonPackageName); } } const searchField = $('#compatibility_page__search-field'); searchField.val(searchTerms.join(',')); searchField.trigger('input').change(); } fileReader.readAsText(file); }); $('#rowsPerPage').on('input', function () { const rowsPerPage = parseInt(this.value); let numberOfVisibleRows = 0; const rows = $('#dataTable tbody tr'); rows.each(function () { if (numberOfVisibleRows < rowsPerPage && !$(this).hasClass('dataTable-filtered-out')) { $(this).show(); numberOfVisibleRows++; } else { $(this).hide(); } }); updatePagination(true); }); $('#pagination-previous').on('click', function () { pageNumber--; updatePagination(false); }); $('#pagination-next').on('click', function () { pageNumber++; updatePagination(false); }); /* top-level version switcher */ $(".compatibility_page-item").click(function () { $(this).addClass("compatibility_page-active").siblings().removeClass("compatibility_page-active"); const graalpyModuleValue = $(".compatibility_page-item.compatibility_page-module.compatibility_page-active").attr("data-filter"); let search = window.location.search; if (search) { search = search.replace(/version=[^&]+&?/, ""); if (search != "?" && !search.endsWith("&")) { search += "&"; } } else { search = "?"; } search += `version=${graalpyModuleValue}`; window.history.pushState("", window.location.title, search); updatePageData(); }); function setFilters() { const params = new URLSearchParams(window.location.search); const graalpyModuleValue = params.get('version') || default_version; const moduleFilterElement = $(`.compatibility_page-module[data-filter=${graalpyModuleValue}]`); moduleFilterElement.addClass("compatibility_page-active").siblings().removeClass("compatibility_page-active"); const packages = params.get('packages') || ""; $('#compatibility_page__search-field').val(packages); } setFilters(); }); </script>

Package Compatibility

GraalPy is compatible with many packages for data science and machine learning, including the popular PyTorch, NumPy, and Huggingface Transformers.

numpy icon

Numeric Computing

We test NumPy across multiple versions and know of multiple deployments where it brings numeric computing to Java.
scipy icon

Scientific Computing

SciPy's rich library for scientific computing is just a package download away.
pandas icon

Data Processing

Thanks to Arrow, Pandas on GraalPy can run multi-threaded while avoiding unneccessary data copies.
huggingface icon

Models for any Task

The Huggingface transformers library works on GraalPy with its huge library of language, vision, and audio models.
pytorch icon

Training and Inference

Train models and run inference on GraalPy with PyTorch, taking full advantage of the latest techniques and accellerator hardware.
pyautogen icon

Agentic Workflows

With Autogen and GraalPy you can write agentic workflows and use Java code to create tools for AI Agents.

Compatibility per GraalPy Release

GraalPy 25.0

GraalPy 24.2

GraalPy 24.1

Over 600 Python packages tested for compatibility with GraalPy

Compatible: loading...
Currently Untested: loading...
Currently Incompatible: loading...
Not Supported: loading...
info icon
Many more Python packages work on GraalPy than are listed here. If there is a package you are interested in that is not included, chances are that it might just work. If it does not, feel free to create an issue for us on GitHub.
Filter by requirements.txt
Python Packages
Name Version Notes
Rows per page: 25 50 100
< >