Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terraform: downgrade python-hcl2 from 4.3.2 to 4.3.0 to work around parsing issues #21361

Merged
merged 2 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/notes/2.23.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ The `tfsec` linter now works on all supported platforms without extra config.

Sandboxes for the `experimental-deploy` deployment (the execution of `terraform apply`) can now be preserved with `--keep-sandboxes`.

[The `terraform-hcl2-parser` subsystem](https://www.pantsbuild.org/2.21/reference/subsystems/terraform-hcl2-parser) downgrades `python-hcl2` version back to 4.3.0 by default to avoid parsing issues introduced afterwards.

Terraform Lockfiles now participate in the dependency graph. `--changed-since` will now include targets affected by the changed lockfile.

The Terraform backend supports creating lockfiles which support multiple platforms. See the [platforms option documentation](https://www.pantsbuild.org/2.23/reference/subsystems/download-terraform#platforms) and the [documentation on lockfiles](https://www.pantsbuild.org/2.23/docs/terraform#lockfiles) for examples.
Expand Down
3 changes: 2 additions & 1 deletion src/python/pants/backend/terraform/dependency_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ class TerraformHcl2Parser(PythonToolRequirementsBase):
options_scope = "terraform-hcl2-parser"
help_short = "Used to parse Terraform modules to infer their dependencies."

default_requirements = ["python-hcl2>=3.0.5,<5"]
# versions 4.3.2+ have parsing issues; bump once resolved
default_requirements = ["python-hcl2>=3.0.5,<=4.3.0"]

register_interpreter_constraints = True

Expand Down
16 changes: 8 additions & 8 deletions src/python/pants/backend/terraform/hcl2.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// "CPython<4,>=3.7"
// ],
// "generated_with_requirements": [
// "python-hcl2<5,>=3.0.5"
// "python-hcl2<=4.3.0,>=3.0.5"
// ],
// "manylinux": "manylinux2014",
// "requirement_constraints": [],
Expand Down Expand Up @@ -54,21 +54,21 @@
"artifacts": [
{
"algorithm": "sha256",
"hash": "e958fe52ca0519e3500eb621caa16be6be9c27870cbcd1879d8c538fb85067ea",
"url": "https://files.pythonhosted.org/packages/34/0a/39813c22334a22b43ffd16acb06aa4541ea1d34bfeab2aa2bcece83a471f/python_hcl2-4.3.2-py3-none-any.whl"
"hash": "6c76d1d523b6fb8ca6d1f70308459f310853e124c4bbfe9fcc018bcacdc78a40",
"url": "https://files.pythonhosted.org/packages/0d/58/32f70aa0d776a467472ee0077929e03d4febb681f6b564cec1d58c09d95b/python_hcl2-4.3.0-py3-none-any.whl"
},
{
"algorithm": "sha256",
"hash": "7122661438be27ccd8b8f3db71969d8ef2cce3b3cf183e88f8172575e7405a65",
"url": "https://files.pythonhosted.org/packages/ef/94/cc6f7100a857a5a4a676c2c71322ca476051278fad4ec956f0116c1d3834/python-hcl2-4.3.2.tar.gz"
"hash": "41e37e2a9b3d223da5e8ebc99e72b40d2315087e966f458f7eac13c7831d9b9e",
"url": "https://files.pythonhosted.org/packages/0b/8c/9c7858604212b25e040652fba3eb06514b363b857544f7321ca97185f001/python-hcl2-4.3.0.tar.gz"
}
],
"project_name": "python-hcl2",
"requires_dists": [
"lark<2,>=1"
],
"requires_python": ">=3.7.0",
"version": "4.3.2"
"version": "4.3.0"
}
],
"platform_tag": null
Expand All @@ -77,11 +77,11 @@
"only_builds": [],
"only_wheels": [],
"path_mappings": {},
"pex_version": "2.2.1",
"pex_version": "2.3.3",
"pip_version": "24.0",
"prefer_older_binary": false,
"requirements": [
"python-hcl2<5,>=3.0.5"
"python-hcl2<=4.3.0,>=3.0.5"
],
"requires_python": [
"<4,>=3.7"
Expand Down
Loading