Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ entry-points."virtualenv.create".graalpy-posix = "virtualenv.create.via_global_r
entry-points."virtualenv.create".graalpy-win = "virtualenv.create.via_global_ref.builtin.graalpy:GraalPyWindows"
entry-points."virtualenv.create".pypy3-posix = "virtualenv.create.via_global_ref.builtin.pypy.pypy3:PyPy3Posix"
entry-points."virtualenv.create".pypy3-win = "virtualenv.create.via_global_ref.builtin.pypy.pypy3:Pypy3Windows"
entry-points."virtualenv.create".rustpython-posix = "virtualenv.create.via_global_ref.builtin.rustpython:RustPythonPosix"
entry-points."virtualenv.create".venv = "virtualenv.create.via_global_ref.venv:Venv"
entry-points."virtualenv.discovery".builtin = "virtualenv.discovery.builtin:Builtin"
entry-points."virtualenv.seed".app-data = "virtualenv.seed.embed.via_app_data.via_app_data:FromAppData"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from __future__ import annotations

from virtualenv.create.via_global_ref.builtin.cpython.cpython3 import CPython3Posix


class RustPythonPosix(CPython3Posix):
"""
Creator for RustPython.

RustPython is mostly compatible with CPython3,
so we can reuse cpython creator code.
"""

@classmethod
def can_describe(cls, interpreter):
return interpreter.implementation == "RustPython"
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from __future__ import annotations

from virtualenv.create.via_global_ref.builtin.rustpython import RustPythonPosix
from virtualenv.discovery.py_info import PythonInfo


def test_can_describe():
"""
Test RustPythonPosix.can_describe() class method.
"""
interpreter = PythonInfo()

# check that RustPython implementation is supported
interpreter.implementation = "RustPython"
assert RustPythonPosix.can_describe(interpreter)

# check that non-RustPython implementation is not supported
interpreter.implementation = "CPython"
assert not RustPythonPosix.can_describe(interpreter)
Loading