Copier worker
Tweaked version of the upstream copier functionality.
See the upstream: https://github.com/copier-org/copier/blob/259f351fc3c017c82b235888c119b9010d80494a/copier/main.py
NavaWorker
dataclass
¶
Bases: Worker
Some (hopefully) small tweaks of upstream functionality.
Copier's upstream exclusion logic only runs against paths after they have
been rendered. This class supports exclusions based on the paths in the
template itself, before they have rendered, via src_exclude
which can be
specified in the copier.yml
file or as arguments in the API call.
Source code in nava/platform/copier_worker.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
|
all_src_exclusions
cached
property
¶
Combine template and user-chosen exclusions.
match_src_exclude
cached
property
¶
Get a callable to match paths against src file exclusions.
__enter__()
¶
Allow using worker as a context manager.
Source code in nava/platform/copier_worker.py
34 35 36 |
|
render_template_file(src_file_path, data=None, render_path=None)
¶
Render an individual file with the template settings.
Source code in nava/platform/copier_worker.py
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
|
render_template_file(src_path, src_file_path, dst_path='.', render_path=None, data=None, **kwargs)
¶
Hackily render an individual file with the template settings.
Source code in nava/platform/copier_worker.py
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
|
run_copy(src_path, dst_path='.', data=None, **kwargs)
¶
Copy a template to a destination, from zero.
Source code in nava/platform/copier_worker.py
84 85 86 87 88 89 90 91 92 93 94 95 |
|
run_update(dst_path='.', data=None, **kwargs)
¶
Update a subproject, from its template.
Source code in nava/platform/copier_worker.py
98 99 100 101 102 103 104 105 106 107 108 |
|