Lines Matching +full:build +full:- +full:system +full:- +full:ubuntu

2 mkvenv - QEMU pyvenv bootstrapping utility
4 usage: mkvenv [-h] command ...
9 -h, --help show this help message and exit
15 post-venv initialization
19 --------------------------------------------------
21 usage: mkvenv create [-h] target
27 -h, --help show this help message and exit
29 --------------------------------------------------
31 usage: mkvenv post_init [-h]
34 -h, --help show this help message and exit
36 --------------------------------------------------
38 usage: mkvenv ensuregroup [-h] [--online] [--dir DIR] file group...
45 -h, --help show this help message and exit
46 --online Install packages from PyPI, if necessary.
47 --dir DIR Path to vendored packages where we may install from.
51 # Copyright (C) 2022-2023 Red Hat, Inc.
58 # later. See the COPYING file in the top-level directory.
92 # HAVE_DISTLIB is checked below, just-in-time, so that mkvenv does not fail
103 import pip._vendor.distlib.scripts # noqa, pylint: disable=unused-import
104 import pip._vendor.distlib.version # noqa, pylint: disable=unused-import
109 # HAVE_TOMLLIB is checked below, just-in-time, so that mkvenv does not fail
127 def inside_a_venv() -> bool:
138 An extension of venv.EnvBuilder for building QEMU's configure-time venv.
147 - system_site_packages: bool = False
148 - clear: bool = False
149 - symlinks: bool = False
150 - upgrade: bool = False
151 - with_pip: bool = False
152 - prompt: Optional[str] = None
153 - upgrade_deps: bool = False (Since 3.9)
156 def __init__(self, *args: Any, **kwargs: Any) -> None:
187 # Make the context available post-creation:
190 def get_parent_libpath(self) -> Optional[str]:
197 def compute_venv_libpath(context: SimpleNamespace) -> str:
215 # code below was the same in Python 3.6-3.10, so there is only
218 return os.path.join(context.env_dir, "Lib", "site-packages")
223 "site-packages",
226 def ensure_directories(self, env_dir: DirType) -> SimpleNamespace:
231 def create(self, env_dir: DirType) -> None:
237 def post_post_setup(self, context: SimpleNamespace) -> None:
252 with open(pth_file, "w", encoding="UTF-8") as file:
263 def get_value(self, field: str) -> str:
265 Get a string value from the context namespace after a call to build.
275 def need_ensurepip() -> bool:
288 def check_ensurepip() -> None:
302 "(Hint: Debian puts ensurepip in its python3-venv package.)"
315 "(Hint: NetBSD's pkgsrc debundles this to e.g. 'py310-expat'.)"
320 def make_venv( # pylint: disable=too-many-arguments
326 ) -> None:
330 This is analogous to the `venv.create` module-level convenience
336 Allow inheriting packages from the system installation.
367 style = "non-isolated" if builder.system_site_packages else "isolated"
383 # pylint: disable=raising-non-exception, raise-missing-from
396 def _stringify(data: Union[str, bytes]) -> str:
419 def _get_entry_points(packages: Sequence[str]) -> Iterator[str]:
421 def _generator() -> Iterator[str]:
445 ) -> None:
474 def pkgname_from_depspec(dep_spec: str) -> str:
476 Parse package name out of a PEP-508 depspec.
478 See https://peps.python.org/pep-0508/#names
481 r"^([A-Z0-9]([A-Z0-9._-]*[A-Z0-9])?)", dep_spec, re.IGNORECASE
491 def _path_is_prefix(prefix: Optional[str], path: str) -> bool:
500 def _is_system_package(dist: Distribution) -> bool:
513 ) -> Tuple[str, bool]:
522 the system. This is used to offer advice when a program is
527 # pylint: disable=too-many-branches
572 f"'{prog}' was detected on your system at '{which}', "
576 "against a different Python interpreter on your system."
580 f"'{prog}' was detected on your system at '{which}', "
581 "but the build is using an isolated virtual environment."
587 lines.insert(0, f"Could not provide build dependency '{dep_spec}':")
597 ) -> None:
609 "-m",
612 "--disable-pip-version-check",
613 "-v" if loud else "-q",
616 full_args += ["--no-index"]
618 full_args += ["--find-links", f"file://{str(wheels_dir)}"]
626 def _make_version_constraint(info: Dict[str, str], install: bool) -> str:
632 :param info: A dictionary corresponding to a TOML key-value list.
654 ) -> Optional[Tuple[str, bool]]:
719 def _parse_groups(file: str) -> Dict[str, Dict[str, Any]]:
728 # Use loads() to support both tomli v1.2.x (Ubuntu 22.04,
729 # Debian bullseye-backports) and v2.0.x
740 ) -> None:
774 def post_venv_setup() -> None:
781 # parent/system-site and haven't run ensurepip in some way.
785 def _add_create_subcommand(subparsers: Any) -> None:
795 def _add_post_init_subcommand(subparsers: Any) -> None:
796 subparsers.add_parser("post_init", help="post-venv initialization")
799 def _add_ensuregroup_subcommand(subparsers: Any) -> None:
805 "--online",
810 "--dir",
830 def main() -> int:
879 except: # pylint: disable=bare-except