This guide explains how to upgrade versions for Bazel, Go, Python, and other dependencies in your project.
These versions are stored in .copier-answers.yml and can be customized per-project:
| Component | File(s) | Copier Variable |
|---|---|---|
| Bazel | .bazeliskrc |
bazel_version |
| Go SDK | MODULE.bazel, go.mod |
go_version |
| Python | MODULE.bazel |
python_version |
These versions are maintained in the template and updated automatically when you update from the template:
| Component | File | Updated Via |
|---|---|---|
rules_go |
MODULE.bazel |
Template update |
gazelle |
MODULE.bazel |
Template update |
rules_python |
MODULE.bazel |
Template update |
aspect_rules_lint |
MODULE.bazel |
Template update |
buildifier |
MODULE.bazel |
Template update |
To get the latest template-managed versions, simply update from the template periodically:
# From the template repository
./update-project.sh /path/to/your/projectEdit .copier-answers.yml to change your preferred versions:
# .copier-answers.yml
bazel_version: "8.6.0"
go_version: "1.25.0"
python_version: "3.13"Then commit and run the update:
# Copier requires a clean working directory
git add .copier-answers.yml
git commit -m "chore: update version settings"
# From the template repository, update project files
./update-project.sh /path/to/your/projectThis approach ensures your version preferences persist through future template updates.
For quick testing or one-off changes, edit the files directly:
Bazel version (.bazeliskrc):
USE_BAZEL_VERSION=8.6.0
Go version (MODULE.bazel and go.mod):
# MODULE.bazel
go_sdk.download(version = "1.25.0")# go.mod
go 1.25
Python version (MODULE.bazel):
pip_ext.parse(
hub_name = "py_deps",
python_version = "3.13",
...
)Note: Direct edits may be overwritten by future template updates unless you also update .copier-answers.yml.
After any version change, verify with:
bazel build //...
bazel test //...Bazel:
curl -s https://api.github.com/repos/bazelbuild/bazel/releases/latest | grep tag_nameGo:
curl -s https://go.dev/VERSION?m=textBazel modules:
# Or visit https://registry.bazel.build/ to see latest versionsIf go.mod and MODULE.bazel have different Go versions:
# Ensure both files use the same version
# go.mod
go 1.24
# MODULE.bazel
go_sdk.download(version = "1.24.2") # Patch version should match or be compatibleAfter upgrading Bazel or toolchains:
# Clean Bazel cache if you encounter issues
bazel clean --expunge
bazel build //...