Skip to content

Conversation

@elmjag
Copy link
Contributor

@elmjag elmjag commented Jan 6, 2026

Adds support for creating virtual environment using RustPython interpreter:
https://github.com/RustPython/RustPython

Without this 'custom' RustPython creator virtualenv fails, when specifying rustpython binary with --python argument. For example:

$ virtualenv --with-traceback --python <...>/target/release/rustpython foo

Traceback (most recent call last):
  File "/opt/mamba/envs/virtenvbug/bin/virtualenv", line 7, in <module>
    sys.exit(run_with_catch())
             ~~~~~~~~~~~~~~^^
  File "/opt/mamba/envs/virtenvbug/lib/python3.14/site-packages/virtualenv/__main__.py", line 68, in run_with_catch
    run(args, options, env)
    ~~~^^^^^^^^^^^^^^^^^^^^
  File "/opt/mamba/envs/virtenvbug/lib/python3.14/site-packages/virtualenv/__main__.py", line 21, in run
    session = cli_run(args, options, env)
  File "/opt/mamba/envs/virtenvbug/lib/python3.14/site-packages/virtualenv/run/__init__.py", line 31, in cli_run
    of_session = session_via_cli(args, options, setup_logging, env)
  File "/opt/mamba/envs/virtenvbug/lib/python3.14/site-packages/virtualenv/run/__init__.py", line 52, in session_via_cli
    creator, seeder, activators = tuple(e.create(options) for e in elements)  # create types
                                  ^^^^^
  File "/opt/mamba/envs/virtenvbug/lib/python3.14/site-packages/virtualenv/run/__init__.py", line 52, in <genexpr>
    creator, seeder, activators = tuple(e.create(options) for e in elements)  # create types
                                        ~~~~~~~~^^^^^^^^^
  File "/opt/mamba/envs/virtenvbug/lib/python3.14/site-packages/virtualenv/run/plugin/creators.py", line 84, in create
    options.describe = self.describe(options, self.interpreter)
                       ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not callable
  • ran the linter to address style issues (tox -e fix)
  • wrote descriptive pull request text
  • ensured there are test(s) validating the fix
  • added news fragment in docs/changelog folder
  • updated/extended the documentation

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.

Tests?

@gaborbernat gaborbernat marked this pull request as draft January 7, 2026 01:48
Adds support for creating virtual environment using RustPython
interpreter: https://github.com/RustPython/RustPython
@elmjag
Copy link
Contributor Author

elmjag commented Jan 7, 2026

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.

Tests?

I have added some tests: #3010 (changes)

This is not sufficient, you'll need to do what we do for PyPy and add it to the CI as a matrix, fix the errors and then would be ready.

@elmjag
Copy link
Contributor Author

elmjag commented Jan 21, 2026

This is not sufficient, you'll need to do what we do for PyPy and add it to the CI as a matrix, fix the errors and then would be ready.

I'm trying to wrap my head around how the virtualenv CI tests work.

As far as I understand, the python version under test is installed with actions/setup-python GitHub action. Then it's picked up by tox, when it is running the tests.

In order to add RustPython to the matrix, I see two options:

  • add support to actions/setup-python so it can install RustPython
  • add special case for RustPython, where it's installed with some different method

Is my understanding correct?

@gaborbernat
Copy link
Contributor

Yes

1 similar comment
@gaborbernat
Copy link
Contributor

Yes

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.

2 participants