nskit.mixer
nskit.mixer.components
nskit.mixer components for building recipes.
File
Bases: FileSystemObject
File component.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/mixer/components/file.py
11 12 13 14 15 16 17 18 19 20 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 |
|
dryrun(base_path, context, override_path=None)
Preview the file contents using the context.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/mixer/components/file.py
49 50 51 52 53 54 55 56 |
|
render_content(context)
Return the rendered content using the context and the Jinja environment.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/mixer/components/file.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
|
validate(base_path, context, override_path=None)
Validate the output against expected.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/mixer/components/file.py
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
|
write(base_path, context, override_path=None)
Write the rendered content to the appropriate path within the base_path
.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/mixer/components/file.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
|
Folder
Bases: FileSystemObject
Folder component.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/mixer/components/folder.py
11 12 13 14 15 16 17 18 19 20 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 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
|
__getitem__(name_or_id)
Get the item by name or id.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/mixer/components/folder.py
77 78 79 80 |
|
__setitem__(name_or_id, value)
Set an item by name or id.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/mixer/components/folder.py
82 83 84 85 86 87 88 89 |
|
dryrun(base_path, context, override_path=None)
Preview the file contents using the context.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/mixer/components/folder.py
25 26 27 28 29 30 31 32 |
|
index(name_or_id)
Get the index of a specific file or folder given the name (or ID).
Source code in .venv-docs/lib/python3.12/site-packages/nskit/mixer/components/folder.py
70 71 72 73 74 75 |
|
validate(base_path, context, override_path=None)
Validate the output against expected.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/mixer/components/folder.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
|
write(base_path, context, override_path=None)
Write the rendered content to the appropriate path within the base_path
.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/mixer/components/folder.py
16 17 18 19 20 21 22 23 |
|
Hook
Bases: ABC
, BaseModel
Hook component.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/mixer/components/hook.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
|
__call__(recipe_path, context)
Call the hook and return tuple (recipe_path, context).
Source code in .venv-docs/lib/python3.12/site-packages/nskit/mixer/components/hook.py
17 18 19 20 21 22 |
|
call(recipe_path, context)
abstractmethod
Return None or tuple (recipe_path, context).
Source code in .venv-docs/lib/python3.12/site-packages/nskit/mixer/components/hook.py
12 13 14 15 |
|
LicenseFile
Bases: File
License File created by downloading from Github.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/mixer/components/license_file.py
119 120 121 122 123 |
|
LicenseOptionsEnum
Bases: Enum
License Options for the license file.
Built from Github API licenses.get_all_commonly_used.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/mixer/components/license_file.py
17 18 19 20 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 |
|
contains(value)
classmethod
Return True if value
is in cls
.
BACKPORT FROM PYTHON 3.12
value
is in cls
if:
1) value
is a member of cls
, or
2) value
is the value of one of the cls
's members.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/mixer/components/license_file.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
|
Recipe
Bases: Folder
The base Recipe object.
A Recipe is a folder, with additional methods for handling context for the Jinja templating.
It also includes hooks that can be run before rendering (pre-hooks
) e.g. checking or changing values,
and after (post-hooks
) e.g. running post-generation steps.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/mixer/components/recipe.py
19 20 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 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 |
|
context
property
Get the context on the initialised recipe.
recipe
property
Recipe context.
recipe_batch
property
Get information about the specific info of this recipe.
__repr__()
Repr(x) == x.repr.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/mixer/components/recipe.py
128 129 130 131 |
|
create(base_path=None, override_path=None, **additional_context)
Create the recipe.
Use the configured parameters and any additional context as kwargs to create the recipe at the base path (or current directory if not provided).
Source code in .venv-docs/lib/python3.12/site-packages/nskit/mixer/components/recipe.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
|
dryrun(base_path=None, override_path=None, **additional_context)
See the recipe as a dry run.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/mixer/components/recipe.py
133 134 135 136 137 138 139 140 141 142 143 |
|
inspect(recipe_name, include_private=False, include_folder=False, include_base=False)
staticmethod
Get the fields on a recipe as an extension.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/mixer/components/recipe.py
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 |
|
load(recipe_name, **kwargs)
staticmethod
Load a recipe as an extension.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/mixer/components/recipe.py
157 158 159 160 161 162 163 164 165 |
|
validate(base_path=None, override_path=None, **additional_context)
Validate the created repo.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/mixer/components/recipe.py
145 146 147 148 149 150 151 152 153 154 155 |
|
nskit.mixer.components.license_file
License file handler.
get_license_filename(context=None)
Callable to set the default license file name.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/mixer/components/license_file.py
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 82 83 84 85 86 87 88 89 90 |
|
get_license_content(context)
Render the content of the license.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/mixer/components/license_file.py
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
|
nskit.mixer.repo
A base recipe object for a code (git) repo.
CodeRecipe
Bases: Recipe
Recipe for a code repo.
Includes default git init and precommit install hooks.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/mixer/repo.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
|
get_pipeline_filenames()
Get CICD Pipeline filenames.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/mixer/repo.py
51 52 53 |
|
RepoMetadata
Bases: BaseConfiguration
Repository/package metadata information.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/mixer/repo.py
26 27 28 29 30 31 32 33 |
|
nskit.mixer.hooks
nskit.mixer.hooks.git
Git hooks.
GitInit
Bases: Hook
Git Hook to (re) initialise a repo.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/mixer/hooks/git.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
|
call(recipe_path, context)
(re)initialise the repo.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/mixer/hooks/git.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
|
nskit.mixer.hooks.pre_commit
Precommit hooks.
Contains post creation precommit install hooks.
PrecommitInstall
Bases: Hook
Precommit install hook.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/mixer/hooks/pre_commit.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
|
call(recipe_path, context)
Run the pre-commit install and install hooks command.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/mixer/hooks/pre_commit.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
|