Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GraalPy support #2859

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Add GraalPy support #2859

wants to merge 8 commits into from

Conversation

timfel
Copy link

@timfel timfel commented Mar 27, 2025

This adds support for creating GraalPy virtualenvs and add GraalPy to the CI. The added code mostly mirrors PyPy3 implementation.

This PR is picking up from #2832

Addressed #2832 (comment)
Addressed #2832 (comment)

The main addition is that we skip coverage reporting and slower tests on GraalPy, because that pushes the CI very close to the limit (had it passing in just seconds shy of the 20min limit on Ubuntu). Skipping a few slower tests and coverage reporting should make it fit comfortably inside the timeout.

/cc @msimacek

@timfel timfel changed the title Graalpy Add GraalPy support Mar 27, 2025
Copy link
Contributor

@gaborbernat gaborbernat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tried implementing and using this as a plugin first?

@msimacek
Copy link

Yes, we were shipping a plugin as a part of GraalPy's distribution for several years now. The first part of the plugin source is now exactly the same as the code submitted here. The second part adds an alternative seeder, which we're not submitting here (that part would stay as a plugin, it's not essential for basic operation).

The problems with having a plugin are:

  1. If you're running virtualenv with CPython and want to install GraalPy (typical usage pattern with tox), you first need to manually install the plugin into your CPython. Without it, virtualenv just fails with TypeError: 'NoneType' object is not callable. A GraalPy user who has seen this for the first time would probably not think of looking for any plugin and it's not like asking google/chatgpt about such a generic error message can point them to it. And a lot of tools use virtualenv behind the scenes, so users might not even know the error comes from virtualenv. TLDR: users need to do an extra step and that step is hard to discover
  2. Some other python projects are interested in adding support for GraalPy. Not having upstream support in virtualenv complicates things needlessly for them. Notably, cibuildwheel wants to support GraalPy, but integrating the plugin installation into the virtualenv backend there proved to be too complicated.

Note that uv already supports creating GraalPy virtualenvs out of the box.

Copy link
Contributor

@gaborbernat gaborbernat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll need to fix the CI before we can merge 👍

@henryiii
Copy link

Cross-referencing cibuildwheel PR: pypa/cibuildwheel#1538

@timfel
Copy link
Author

timfel commented Mar 29, 2025

You'll need to fix the CI before we can merge 👍

I don't understand why those two builds timed out - they seem to just have hung? I ran the check in our fork and it just passed (as I would expect): https://github.com/msimacek/virtualenv/actions/runs/14131798860

Can you just restart the two jobs to double check?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants