feat(python): add Python module#947
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new community Terraform module under registry/attractivetoad to install Python tooling on Debian/Ubuntu Coder workspaces, using coder-utils for script orchestration and standardized module log/script directories.
Changes:
- Introduces
attractivetoad/pythonmodule with an apt-based install script andcoder-utilsorchestration. - Adds Terraform (
.tftest.hcl) and TypeScript (main.test.ts) tests for the new module. - Adds a Python icon and namespace/module documentation.
Reviewed changes
Copilot reviewed 6 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
registry/attractivetoad/README.md |
Adds new namespace README and module listing. |
registry/attractivetoad/modules/python/main.tf |
Implements the Python module, inputs, coder-utils wiring, and outputs. |
registry/attractivetoad/modules/python/scripts/install.sh.tftpl |
Adds the apt-based installation script. |
registry/attractivetoad/modules/python/README.md |
Documents module usage and examples. |
registry/attractivetoad/modules/python/main.tftest.hcl |
Adds Terraform plan-time assertions for defaults/outputs. |
registry/attractivetoad/modules/python/main.test.ts |
Adds TS test for required variables/init. |
.icons/python.svg |
Adds Python SVG icon used by the module README/UI. |
c7ceacb to
da0fa28
Compare
da0fa28 to
78d4c1c
Compare
35C4n0r
left a comment
There was a problem hiding this comment.
@AttractiveToad would you consider using pyenv instead for python installation and version management ?
If the current way suits your needs better, I'm good with that too.
| resource "coder_script" "install" { | ||
| agent_id = var.agent_id | ||
| display_name = "Python: Install Script" | ||
| icon = var.icon | ||
| run_on_start = true | ||
| start_blocks_login = true | ||
| script = templatefile("${path.module}/scripts/install.sh.tftpl", { | ||
| PYTHON_PACKAGES = join(" ", var.python_packages) | ||
| UPDATE_PACKAGES = tostring(var.update_packages) | ||
| CREATE_PYTHON_ALIAS = tostring(var.create_python_alias) | ||
| }) | ||
| } |
There was a problem hiding this comment.
Consider using coder-utils instead, it will also write the script and logs to standardized paths.
There was a problem hiding this comment.
Check codex module for example:
registry/registry/coder-labs/modules/codex/main.tf
Lines 159 to 175 in 1a077c8
| output "scripts" { | ||
| description = "Ordered list of script names produced by this module, in run order." | ||
| value = ["attractivetoad-python-install"] | ||
| } |
There was a problem hiding this comment.
We are not using coder exp sync in the scripts here, if you switch to coder-utils, the script names will be exposed and you can forward it as this module's output. Check codex module for example:
registry/registry/coder-labs/modules/codex/main.tf
Lines 159 to 175 in 1a077c8
Summary
Tests