nskit.recipes
nskit.recipes.recipe.RecipeRecipe
Bases: PyRecipe
A Recipe for creating Recipes, meta!
Source code in .venv-docs/lib/python3.12/site-packages/nskit/recipes/recipe.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
|
contents: List[Union[File, Folder]] = Field([ingredients.gitignore, ingredients.noxfile, ingredients.pre_commit, recipe_ingredients.pyproject_toml, recipe_ingredients.readme_md, ingredients.test_dir, recipe_ingredients.src_dir, ingredients.docs_dir, LicenseFile()], description='The folder contents')
class-attribute
instance-attribute
nskit.recipes.python.api.APIRecipe
Bases: PyRecipe
API Service Recipe.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/recipes/python/api.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
|
contents: List[Union[File, Folder]] = Field([ingredients.gitignore, ingredients.noxfile, ingredients.pre_commit, api_ingredients.pyproject_toml, api_ingredients.readme_md, ingredients.test_dir, api_ingredients.src_dir, api_ingredients.docker.dockerignore, api_ingredients.docker.api_dockerfile, ingredients.docs_dir, LicenseFile()], description='The folder contents')
class-attribute
instance-attribute
nskit.recipes.python.package.PackageRecipe
Bases: PyRecipe
Package Recipe.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/recipes/python/package.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
|
contents: List[Union[File, Folder]] = Field([ingredients.gitignore, ingredients.noxfile, ingredients.pre_commit, ingredients.pyproject_toml, ingredients.readme_md, ingredients.test_dir, ingredients.src_dir, ingredients.docs_dir, LicenseFile()], description='The folder contents')
class-attribute
instance-attribute
Python Ingredients
nskit.recipes.python.PyRecipe
Bases: CodeRecipe
Base recipe for python recipes.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/recipes/python/__init__.py
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
|
name: str = Field(None, validate_default=True, description='The repository name')
class-attribute
instance-attribute
version: str = __version__
class-attribute
instance-attribute
Version of the recipe.
repo: PyRepoMetadata = Field(...)
class-attribute
instance-attribute
Python repo metadata.
pre_hooks: List[Hook] = Field(default_factory=list, validate_default=True, description='Hooks that can be used to modify a recipe path and context before writing')
class-attribute
instance-attribute
post_hooks: Optional[List[Callable]] = Field([hooks.git.GitInit(), hooks.pre_commit.PrecommitInstall()], validate_default=True, description='Hooks that can be used to modify a recipe path and context after writing')
class-attribute
instance-attribute
extension_name: Optional[str] = Field(None, description='The name of the recipe as an extension to load.')
class-attribute
instance-attribute
git: GitConfig = GitConfig()
class-attribute
instance-attribute
context
property
Get the context on the initialised recipe.
recipe_batch
property
Get information about the specific info of this recipe.
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 |
|
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 |
|
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 |
|
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 |
|
nskit.recipes.python.PyRepoMetadata
Bases: RepoMetadata
Repo Metadata for python templates.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/recipes/python/__init__.py
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 |
|
owner: str = Field(..., description='Who is the owner of the repo')
class-attribute
instance-attribute
email: EmailStr = Field(..., description='The email for the repo owner')
class-attribute
instance-attribute
url: HttpUrl = Field(..., description='The Repository url.')
class-attribute
instance-attribute
name
property
writable
Get repo name.
py_name
property
Get python module name.
py_root
property
Get root python module name.
src_path
property
Get module folder structure (src not included).
module_depth: int
property
Get the module depth.
a.b.c
has a depth of 3, a
has a depth of 1
nskit.recipes.python.ingredients
Ingredients for repos.
gitignore = File(name='.gitignore', content='nskit.recipes.python.ingredients:gitignore.template')
module-attribute
noxfile = File(name='noxfile.py', content='nskit.recipes.python.ingredients:noxfile.py.template')
module-attribute
pre_commit = File(name='.pre-commit-config.yaml', content='nskit.recipes.python.ingredients:pre-commit-config.yaml.template')
module-attribute
pyproject_toml = File(name='pyproject.toml', content='nskit.recipes.python.ingredients:pyproject.toml.template')
module-attribute
readme_md = File(name='README.md', content='nskit.recipes.python.ingredients:readme.md.template')
module-attribute
test_dir = Folder(name='tests', contents=[Folder(name='unit', contents=[File(name='test_placeholder.py', content=test_placeholder)]), Folder(name='functional', contents=[File(name='.git-keep', content='')])])
module-attribute
src_dir = Folder(name='src', contents=[Folder(id_='src_path', name='{{repo.src_path}}', contents=[File(name='__init__.py', content='nskit.recipes.python.ingredients:__init__.py.template')])])
module-attribute
nskit.recipes.python.ingredients.api
API Service ingredients.
Contains fastapi based api service ingredients.
pyproject_toml = File(name='pyproject.toml', content='nskit.recipes.python.ingredients.api:pyproject.toml.template')
module-attribute
readme_md = File(name='README.md', content='nskit.recipes.python.ingredients.api:readme.md.template')
module-attribute
src_dir
Adds app.py
, auth.py
, server.py
, api/__init__.py
, base.py
to [nskit.recipes.python.ingredients.src_dir]
nskit.recipes.python.ingredients.api.docker
Docker ingredients.
Contains dockerfile, .dockerignore files.
api_dockerfile = File(name='Dockerfile', content='nskit.recipes.python.ingredients.api.docker:api.Dockerfile.template')
module-attribute
dockerignore = File(name='.dockerignore', content='nskit.recipes.python.ingredients.api.docker:dockerignore.template')
module-attribute
nskit.recipes.python.ingredients.recipe
Ingredients for a recipe recipe.
pyproject_toml = File(name='pyproject.toml', content='nskit.recipes.python.ingredients.recipe:pyproject.toml.template')
module-attribute
readme_md = File(name='README.md', content='nskit.recipes.python.ingredients.recipe:readme.md.template')
module-attribute
src_dir
Adds recipe.py
and ingredient.py.template
to [nskit.recipes.python.ingredients.src_dir]