REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 2.12 KB
Close
/opt/alt/python37/lib/python3.7/site-packages/virtualenv/seed/embed/pip_invoke.py
Text
Base64
from __future__ import absolute_import, unicode_literals import logging from contextlib import contextmanager from virtualenv.discovery.cached_py_info import LogCmd from virtualenv.seed.embed.base_embed import BaseEmbed from virtualenv.util.subprocess import Popen from ..wheels import Version, get_wheel, pip_wheel_env_run class PipInvoke(BaseEmbed): def __init__(self, options): super(PipInvoke, self).__init__(options) def run(self, creator): if not self.enabled: return for_py_version = creator.interpreter.version_release_str with self.get_pip_install_cmd(creator.exe, for_py_version) as cmd: env = pip_wheel_env_run(self.extra_search_dir, self.app_data, self.env) self._execute(cmd, env) @staticmethod def _execute(cmd, env): logging.debug("pip seed by running: %s", LogCmd(cmd, env)) process = Popen(cmd, env=env) process.communicate() if process.returncode != 0: raise RuntimeError("failed seed with code {}".format(process.returncode)) return process @contextmanager def get_pip_install_cmd(self, exe, for_py_version): cmd = [str(exe), "-m", "pip", "-q", "install", "--only-binary", ":all:", "--disable-pip-version-check"] if not self.download: cmd.append("--no-index") folders = set() for dist, version in self.distribution_to_versions().items(): wheel = get_wheel( distribution=dist, version=version, for_py_version=for_py_version, search_dirs=self.extra_search_dir, download=False, app_data=self.app_data, do_periodic_update=self.periodic_update, env=self.env, ) if wheel is None: raise RuntimeError("could not get wheel for distribution {}".format(dist)) folders.add(str(wheel.path.parent)) cmd.append(Version.as_pip_req(dist, wheel.version)) for folder in sorted(folders): cmd.extend(["--find-links", str(folder)]) yield cmd
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 2 × Files: 3
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
via_app_data
DIR
-
drwxr-xr-x
2024-03-03 22:53:22
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
__pycache__
DIR
-
drwxr-xr-x
2024-03-03 22:53:22
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
base_embed.py
4.08 KB
lrw-r--r--
2022-01-02 15:54:28
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
pip_invoke.py
2.12 KB
lrw-r--r--
2022-01-02 15:54:28
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
__init__.py
0 B
lrw-r--r--
2022-01-02 15:54:28
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).