Skip to content
Merged
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 @@ -49,6 +49,7 @@ dependencies = [
"filelock>=3.24.2,<4; python_version>='3.10'",
"importlib-metadata>=6.6; python_version<'3.8'",
"platformdirs>=3.9.1,<5",
"python-discovery>=1",
"typing-extensions>=4.13.2; python_version<'3.11'",
]
urls.Documentation = "https://virtualenv.pypa.io"
Expand Down
3 changes: 2 additions & 1 deletion src/virtualenv/activation/activator.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
from argparse import ArgumentParser
from pathlib import Path

from python_discovery import PythonInfo

from virtualenv.config.cli.parser import VirtualEnvOptions
from virtualenv.create.creator import Creator
from virtualenv.discovery.py_info import PythonInfo


class Activator(ABC):
Expand Down
12 changes: 7 additions & 5 deletions src/virtualenv/create/creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
if TYPE_CHECKING:
from argparse import ArgumentParser

from python_discovery import PythonInfo

from virtualenv.app_data.base import AppData
from virtualenv.config.cli.parser import VirtualEnvOptions
from virtualenv.discovery.py_info import PythonInfo

from virtualenv.discovery.cached_py_info import LogCmd
from virtualenv.util.path import safe_delete
from virtualenv.util.subprocess import run_cmd
from virtualenv.util.subprocess import LogCmd, run_cmd
from virtualenv.version import __version__

from .pyenv_cfg import PyEnvCfg
Expand Down Expand Up @@ -198,11 +198,13 @@ def add_cachedir_tag(self):

def set_pyenv_cfg(self):
self.pyenv_cfg.content = OrderedDict()
self.pyenv_cfg["home"] = os.path.dirname(os.path.abspath(self.interpreter.system_executable))
system_executable = self.interpreter.system_executable or self.interpreter.executable
assert system_executable is not None # noqa: S101
self.pyenv_cfg["home"] = os.path.dirname(os.path.abspath(system_executable))
self.pyenv_cfg["implementation"] = self.interpreter.implementation
self.pyenv_cfg["version_info"] = ".".join(str(i) for i in self.interpreter.version_info)
self.pyenv_cfg["version"] = ".".join(str(i) for i in self.interpreter.version_info[:3])
self.pyenv_cfg["executable"] = os.path.realpath(self.interpreter.system_executable)
self.pyenv_cfg["executable"] = os.path.realpath(system_executable)
self.pyenv_cfg["command"] = f"{sys.executable} -m virtualenv {self.dest}"
self.pyenv_cfg["virtualenv"] = __version__
if self.prompt is not None:
Expand Down
3 changes: 2 additions & 1 deletion src/virtualenv/create/via_global_ref/venv.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
import logging
from copy import copy

from python_discovery import PythonInfo

from virtualenv.create.via_global_ref.store import handle_store_python
from virtualenv.discovery.py_info import PythonInfo
from virtualenv.util.error import ProcessCallFailedError
from virtualenv.util.path import ensure_dir
from virtualenv.util.subprocess import run_cmd
Expand Down
Loading
Loading