Download a skill zip and its checksum via the modeled API. Returns (zip_bytes, checksum_hex, resolved_version).
(client, skill_name, version=None)
| 79 | |
| 80 | |
| 81 | def get_skill_download(client, skill_name, version=None): |
| 82 | """ |
| 83 | Download a skill zip and its checksum via the modeled API. |
| 84 | |
| 85 | Returns (zip_bytes, checksum_hex, resolved_version). |
| 86 | """ |
| 87 | |
| 88 | # Actually look up the latest version instead of just passing 'latest', |
| 89 | # this lets us write out the new version to the metadata file without |
| 90 | # inspecting the zip contents |
| 91 | if version is None: |
| 92 | version = resolve_latest_version(client, skill_name) |
| 93 | |
| 94 | response = client.get_skill_file( |
| 95 | name=skill_name, skillVersion=version, filePath='download' |
| 96 | ) |
| 97 | zip_bytes = response['body'].read() |
| 98 | |
| 99 | response = client.get_skill_file_checksum( |
| 100 | name=skill_name, skillVersion=version, filePath='download' |
| 101 | ) |
| 102 | checksum = response['body'].strip().lower().split()[0] |
| 103 | return zip_bytes, checksum, version |
| 104 | |
| 105 | |
| 106 | def read_installed_version(skill_dir): |
no test coverage detected