nskit.vcs
VCS and Codebase handlers for creating repo (and build) infrastructure.
NamespaceOptionsType = TypeAliasType('NamespaceOptionsType', List[Union[str, Dict[str, 'NamespaceOptionsType']]])
module-attribute
Codebase
Bases: BaseConfiguration
Object for managing a codebase.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/vcs/codebase.py
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 |
|
namespace_validator
property
Get the namespace validator object.
clone()
Clone all repos that match the codebase to a local (nested) directory.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/vcs/codebase.py
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
|
create_namespace_repo(name=None, *, namespace_options, delimiters=None, repo_separator=None, namespaces_filename='namespaces.yaml')
Create and populate the validator repo.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/vcs/codebase.py
150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 |
|
create_repo(name, with_recipe=None, **recipe_kwargs)
Create a repo in the codebase.
with_recipe will instantiate it with a specific recipe - the kwargs need to be provided to the call.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/vcs/codebase.py
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 |
|
delete_repo(name)
Delete a repo from the codebase.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/vcs/codebase.py
139 140 141 142 143 144 145 146 147 148 |
|
list_repos()
Get the repo names that are validated by the namespace_validator if provided.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/vcs/codebase.py
70 71 72 73 74 75 76 77 78 |
|
model_post_init(*args, **kwargs)
Set the settings namespace validation repo to the same as the codebase.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/vcs/codebase.py
57 58 59 60 |
|
Repo
Bases: _Repo
Repo with namespace validator.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/vcs/repo.py
314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 |
|
NamespaceValidator
Bases: BaseConfiguration
Namespace Validator object.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/vcs/namespace_validator.py
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 |
|
to_parts(name)
Break the name into the namespace parts.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/vcs/namespace_validator.py
51 52 53 54 55 |
|
to_repo_name(name)
Convert the name to the appropriate name with a given repo separator.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/vcs/namespace_validator.py
57 58 59 |
|
validate_name(proposed_name)
Validate a proposed name.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/vcs/namespace_validator.py
61 62 63 64 65 66 67 68 69 70 |
|
Installers
Repository installers.
Installer
Bases: ABC
, BaseConfiguration
Abstract class for language installer.
Can be enabled or disabled using the boolean flag and environment variables.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/vcs/installer.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
|
check(path, **kwargs)
Check if the installer is enabled, and the repo matches the criteria.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/vcs/installer.py
36 37 38 |
|
check_repo(path, **kwargs)
abstractmethod
Check if the repo matches the installer language.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/vcs/installer.py
40 41 42 43 |
|
install(path, *, codebase=None, deps=True, **kwargs)
abstractmethod
Install the repo into the appropriate environment.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/vcs/installer.py
45 46 47 48 |
|
PythonInstaller
Bases: Installer
Python language installer.
Can be enabled or disabled using the boolean flag and environment variables. The virtualenv config can be updated (to a custom dir/path relative to the codebase root)
Source code in .venv-docs/lib/python3.12/site-packages/nskit/vcs/installer.py
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 |
|
check_repo(path)
Check if this is a python repo.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/vcs/installer.py
63 64 65 66 67 68 |
|
install(path, *, codebase=None, executable='venv', deps=True)
Install the repo.
executable can override the executable to use (e.g. a virtualenv) deps controls whether dependencies are installed or not.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/vcs/installer.py
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
|
Providers
Abstract Client
Abstract classes for the provider.
RepoClient
Bases: ABC
Repo management client.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/vcs/providers/abstract.py
10 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 |
|
check_exists(repo_name)
abstractmethod
Check if the repo exists on the remote.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/vcs/providers/abstract.py
35 36 37 38 |
|
create(repo_name)
abstractmethod
Create a repo.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/vcs/providers/abstract.py
13 14 15 16 |
|
delete(repo_name)
abstractmethod
Delete a repo.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/vcs/providers/abstract.py
30 31 32 33 |
|
get_clone_url(repo_name)
Get the clone URL.
This defaults to the remote url unless specifically implemented.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/vcs/providers/abstract.py
23 24 25 26 27 28 |
|
get_remote_url(repo_name)
abstractmethod
Get the remote url for a repo.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/vcs/providers/abstract.py
18 19 20 21 |
|
list()
abstractmethod
List all repos on the remote.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/vcs/providers/abstract.py
40 41 42 43 |
|
VCSProviderSettings
Bases: ABC
, BaseConfiguration
Settings for VCS Provider.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/vcs/providers/abstract.py
46 47 48 49 50 51 52 |
|
repo_client()
Return the instantiated repo client object for the provider.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/vcs/providers/abstract.py
49 50 51 52 |
|
Azure Devops
Azure Devops provider using azure-cli to manage it.
AzureDevOpsRepoClient
Bases: RepoClient
Client for managing Azure DevOps repos using azure-cli.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/vcs/providers/azure_devops.py
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 |
|
__init__(config)
Initialise the client.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/vcs/providers/azure_devops.py
46 47 48 49 |
|
check_exists(repo_name)
Check if the repo exists in the project.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/vcs/providers/azure_devops.py
54 55 56 57 58 59 60 61 62 63 64 65 |
|
create(repo_name)
Create the repo in the project.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/vcs/providers/azure_devops.py
67 68 69 70 71 72 73 74 75 76 77 78 |
|
delete(repo_name)
Delete the repo if it exists in the project.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/vcs/providers/azure_devops.py
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 |
|
get_remote_url(repo_name)
Get the remote url for the repo.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/vcs/providers/azure_devops.py
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
|
list()
List the repos in the project.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/vcs/providers/azure_devops.py
125 126 127 128 129 130 131 132 133 134 135 136 137 138 |
|
AzureDevOpsSettings
Bases: VCSProviderSettings
Azure DevOps settings.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/vcs/providers/azure_devops.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
|
organisation_url
property
Get the organistion Url.
project_url
property
Get the project url.
repo_client: AzureDevOpsRepoClient
property
Get the instantiated repo client.
Github
Github provider using ghapi.
GithubOrgType
Bases: Enum
Org type, user or org.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/vcs/providers/github.py
62 63 64 65 |
|
GithubRepoClient
Bases: RepoClient
Client for managing github repos.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/vcs/providers/github.py
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 |
|
__init__(config)
Initialise the client.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/vcs/providers/github.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
|
check_exists(repo_name)
Check if the repo exists in the organisation/user.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/vcs/providers/github.py
123 124 125 126 127 128 129 |
|
create(repo_name)
Create the repo in the user/organisation.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/vcs/providers/github.py
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
|
delete(repo_name)
Delete the repo if it exists in the organisation/user.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/vcs/providers/github.py
118 119 120 121 |
|
get_clone_url(repo_name)
Get the clone url for the repo.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/vcs/providers/github.py
113 114 115 116 |
|
get_remote_url(repo_name)
Get the remote url for the repo.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/vcs/providers/github.py
108 109 110 111 |
|
list()
List the repos in the project.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/vcs/providers/github.py
131 132 133 134 135 136 137 138 139 140 |
|
GithubRepoSettings
Bases: BaseConfiguration
Github Repo settings.
Source code in .venv-docs/lib/python3.12/site-packages/nskit/vcs/providers/github.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
|
GithubSettings
Bases: VCSProviderSettings
Github settings.
Uses PAT token for auth (set in environment variables as GITHUB_TOKEN)
Source code in .venv-docs/lib/python3.12/site-packages/nskit/vcs/providers/github.py
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 |
|
repo_client: GithubRepoClient
property
Get the instantiated repo client.