Skip to content

Commit 209d566

Browse files
committed
Add windows support for graalpy_virtualenv
1 parent cbc1707 commit 209d566

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

graalpy_virtualenv/graalpy_virtualenv/graalpy.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@
4343
from subprocess import check_output as subprocess_check_output
4444

4545
from virtualenv.create.creator import Creator
46-
from virtualenv.create.describe import PosixSupports
46+
from virtualenv.create.describe import PosixSupports, WindowsSupports
4747
from virtualenv.seed.embed.pip_invoke import PipInvoke
4848
from virtualenv.seed.wheels import get_wheel
4949
from virtualenv.seed.wheels.bundle import from_dir
5050

5151

52-
class GraalPyCreatorPosix(Creator, PosixSupports):
52+
class AbstractGraalPyCreator(Creator):
5353
"""
5454
Describe and fake Creator service for GraalPy.
5555
@@ -115,13 +115,21 @@ def create(self):
115115
"or environment variable VIRTUALENV_CREATOR=venv")
116116

117117

118+
class GraalPyCreatorPosix(AbstractGraalPyCreator, PosixSupports):
119+
pass
120+
121+
122+
class GraalPyCreatorWindows(AbstractGraalPyCreator, WindowsSupports):
123+
pass
124+
125+
118126
@lru_cache()
119127
def get_ensurepip_path(exe):
120128
if exe.samefile(sys.executable):
121129
import ensurepip
122130
ensurepip_path = ensurepip.__path__[0]
123131
else:
124-
cmd = [exe, "-u", "-c", 'import ensurepip; print(ensurepip.__path__[0])']
132+
cmd = [str(exe), "-u", "-c", 'import ensurepip; print(ensurepip.__path__[0])']
125133
ensurepip_path = subprocess_check_output(cmd, universal_newlines=True).strip()
126134
return Path(ensurepip_path) / '_bundled'
127135

graalpy_virtualenv/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ dependencies = [
5959

6060
[project.entry-points."virtualenv.create"]
6161
graalpy-posix = "graalpy_virtualenv.graalpy:GraalPyCreatorPosix"
62+
graalpy-windows = "graalpy_virtualenv.graalpy:GraalPyCreatorWindows"
6263

6364
[project.entry-points."virtualenv.seed"]
6465
graalpy = "graalpy_virtualenv:graalpy.GraalPySeeder"

0 commit comments

Comments
 (0)