poetry
This module contains functions used to install poetry dependecies and kernels.
check_and_fix_onprem_source(project_root)
Check if running onprem and fix source in pyproject.toml if so.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
project_root
|
Path
|
Path to the root of the project |
required |
Source code in ssb_project_cli/ssb_project/build/poetry.py
200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 |
|
install_ipykernel(project_directory, project_name)
Installs ipykernel.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
project_directory
|
Path
|
Path of project |
required |
project_name
|
str
|
Name of project |
required |
Source code in ssb_project_cli/ssb_project/build/poetry.py
174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
poetry_install(project_directory)
Call poetry install in project_directory.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
project_directory
|
Path
|
Path of project |
required |
Source code in ssb_project_cli/ssb_project/build/poetry.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
|
poetry_source_add(source_url, cwd, source_name=NEXUS_SOURCE_NAME)
Add a package installation source for this project.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
source_url
|
str
|
URL of 'simple' package API of package server |
required |
cwd
|
Path
|
Path of project to add source to |
required |
source_name
|
str
|
Name of source to add |
NEXUS_SOURCE_NAME
|
Source code in ssb_project_cli/ssb_project/build/poetry.py
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 |
|
poetry_source_includes_source_name(cwd, source_name=NEXUS_SOURCE_NAME)
Check whether this source is already added to the project.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
cwd
|
Path
|
Path of project to add source to |
required |
source_name
|
str
|
Name of source to check |
NEXUS_SOURCE_NAME
|
Returns:
Type | Description |
---|---|
bool
|
True if the source exists in the list |
Source code in ssb_project_cli/ssb_project/build/poetry.py
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
|
poetry_source_remove(cwd, lock_update=True, source_name=NEXUS_SOURCE_NAME)
Remove a package installation source for this project.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
cwd
|
Path
|
Path of project to add source to |
required |
lock_update
|
bool
|
Bool used to decide whether to run update_lock |
True
|
source_name
|
str
|
Name of source to be removed |
NEXUS_SOURCE_NAME
|
Source code in ssb_project_cli/ssb_project/build/poetry.py
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
|
poetry_update_lockfile_dependencies(project_directory)
Call poetry update --lock in project_directory.
Update the lock file dependencies without installing packages.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
project_directory
|
Path
|
Path of project |
required |
Source code in ssb_project_cli/ssb_project/build/poetry.py
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 |
|
should_update_lock_file(source_url, cwd)
Checks if poetry.lock exists and if nexus source is set there.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
source_url
|
str
|
URL of 'simple' package API of package server |
required |
cwd
|
Path
|
Path of project to add source to |
required |
Returns: True if source url is not set in lock file, else False.
Source code in ssb_project_cli/ssb_project/build/poetry.py
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 |
|
update_lock(cwd)
Runs poetry lock --no-update command in CWD.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
cwd
|
Path
|
Path of project to add source to. |
required |
Source code in ssb_project_cli/ssb_project/build/poetry.py
138 139 140 141 142 143 144 145 146 147 148 149 150 151 |
|