Update a subproject, from its template.
(
dst_path: Path | str = ".",
data: dict[str, Any] | None = None,
*,
answers_file: Path | str | None = None,
vcs_ref: str | VcsRef | None = None,
settings: Settings | SettingsModel | None = None,
exclude: Sequence[str] = (),
use_prereleases: bool = False,
skip_if_exists: Sequence[str] = (),
cleanup_on_error: bool = True,
defaults: bool = False,
user_defaults: dict[str, Any] | None = None,
overwrite: bool = False,
pretend: bool = False,
quiet: bool = False,
conflict: Literal["inline", "rej"] = "inline",
context_lines: PositiveInt = 3,
unsafe: bool = False,
skip_answered: bool = False,
skip_tasks: bool = False,
)
| 1794 | |
| 1795 | |
| 1796 | def run_update( |
| 1797 | dst_path: Path | str = ".", |
| 1798 | data: dict[str, Any] | None = None, |
| 1799 | *, |
| 1800 | answers_file: Path | str | None = None, |
| 1801 | vcs_ref: str | VcsRef | None = None, |
| 1802 | settings: Settings | SettingsModel | None = None, |
| 1803 | exclude: Sequence[str] = (), |
| 1804 | use_prereleases: bool = False, |
| 1805 | skip_if_exists: Sequence[str] = (), |
| 1806 | cleanup_on_error: bool = True, |
| 1807 | defaults: bool = False, |
| 1808 | user_defaults: dict[str, Any] | None = None, |
| 1809 | overwrite: bool = False, |
| 1810 | pretend: bool = False, |
| 1811 | quiet: bool = False, |
| 1812 | conflict: Literal["inline", "rej"] = "inline", |
| 1813 | context_lines: PositiveInt = 3, |
| 1814 | unsafe: bool = False, |
| 1815 | skip_answered: bool = False, |
| 1816 | skip_tasks: bool = False, |
| 1817 | ) -> Worker: |
| 1818 | """Update a subproject, from its template.""" |
| 1819 | with Worker( |
| 1820 | dst_path=Path(dst_path), |
| 1821 | data=data or {}, |
| 1822 | answers_file=( |
| 1823 | RelativePath(answers_file) |
| 1824 | if isinstance(answers_file, str) |
| 1825 | else answers_file |
| 1826 | ), |
| 1827 | vcs_ref=vcs_ref, |
| 1828 | settings=( |
| 1829 | SettingsModel(defaults=settings.defaults, trust=settings.trust) |
| 1830 | if isinstance(settings, Settings) |
| 1831 | else (settings or SettingsModel.from_file()) |
| 1832 | ), |
| 1833 | exclude=exclude, |
| 1834 | use_prereleases=use_prereleases, |
| 1835 | skip_if_exists=skip_if_exists, |
| 1836 | cleanup_on_error=cleanup_on_error, |
| 1837 | defaults=defaults, |
| 1838 | user_defaults=user_defaults or {}, |
| 1839 | overwrite=overwrite, |
| 1840 | pretend=pretend, |
| 1841 | quiet=quiet, |
| 1842 | conflict=conflict, |
| 1843 | context_lines=context_lines, |
| 1844 | unsafe=unsafe, |
| 1845 | skip_answered=skip_answered, |
| 1846 | skip_tasks=skip_tasks, |
| 1847 | ) as worker: |
| 1848 | worker.run_update() |
| 1849 | return worker |
| 1850 | |
| 1851 | |
| 1852 | def get_update_data( |