Construct a repository from command-line arguments. The provided namespace must contain the options installed by `Repository.install_arguments`.
(cls, root: Path, args: argparse.Namespace)
| 1651 | |
| 1652 | @classmethod |
| 1653 | def from_arguments(cls, root: Path, args: argparse.Namespace) -> "Repository": |
| 1654 | """Construct a repository from command-line arguments. |
| 1655 | |
| 1656 | The provided namespace must contain the options installed by |
| 1657 | `Repository.install_arguments`. |
| 1658 | """ |
| 1659 | if args.release: |
| 1660 | profile = Profile.RELEASE |
| 1661 | elif args.optimized: |
| 1662 | profile = Profile.OPTIMIZED |
| 1663 | elif args.dev: |
| 1664 | profile = Profile.DEV |
| 1665 | else: |
| 1666 | profile = ( |
| 1667 | Profile.RELEASE if ui.env_is_truthy("CI_LTO") else Profile.OPTIMIZED |
| 1668 | ) |
| 1669 | |
| 1670 | return cls( |
| 1671 | root, |
| 1672 | profile=profile, |
| 1673 | coverage=args.coverage, |
| 1674 | sanitizer=args.sanitizer, |
| 1675 | image_registry=args.image_registry, |
| 1676 | image_prefix=args.image_prefix, |
| 1677 | arch=args.arch, |
| 1678 | ) |
| 1679 | |
| 1680 | @property |
| 1681 | def root(self) -> Path: |
no outgoing calls
no test coverage detected