python-hcl2 7.0.0__tar.gz → 7.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. python_hcl2-7.0.1/.github/ISSUE_TEMPLATE/hcl2-parsing-error.md +32 -0
  2. {python_hcl2-7.0.0 → python_hcl2-7.0.1}/CHANGELOG.md +6 -0
  3. {python_hcl2-7.0.0/python_hcl2.egg-info → python_hcl2-7.0.1}/PKG-INFO +1 -1
  4. {python_hcl2-7.0.0 → python_hcl2-7.0.1}/hcl2/hcl2.lark +3 -2
  5. {python_hcl2-7.0.0 → python_hcl2-7.0.1}/hcl2/transformer.py +3 -0
  6. {python_hcl2-7.0.0 → python_hcl2-7.0.1}/hcl2/version.py +2 -2
  7. {python_hcl2-7.0.0 → python_hcl2-7.0.1/python_hcl2.egg-info}/PKG-INFO +1 -1
  8. {python_hcl2-7.0.0 → python_hcl2-7.0.1}/python_hcl2.egg-info/SOURCES.txt +1 -0
  9. {python_hcl2-7.0.0 → python_hcl2-7.0.1}/.codacy.yml +0 -0
  10. {python_hcl2-7.0.0 → python_hcl2-7.0.1}/.coveragerc +0 -0
  11. {python_hcl2-7.0.0 → python_hcl2-7.0.1}/.github/CODEOWNERS +0 -0
  12. {python_hcl2-7.0.0 → python_hcl2-7.0.1}/.github/workflows/codeql-analysis.yml +0 -0
  13. {python_hcl2-7.0.0 → python_hcl2-7.0.1}/.github/workflows/pr_check.yml +0 -0
  14. {python_hcl2-7.0.0 → python_hcl2-7.0.1}/.github/workflows/publish.yml +0 -0
  15. {python_hcl2-7.0.0 → python_hcl2-7.0.1}/.gitignore +0 -0
  16. {python_hcl2-7.0.0 → python_hcl2-7.0.1}/.pre-commit-config.yaml +0 -0
  17. {python_hcl2-7.0.0 → python_hcl2-7.0.1}/.yamllint.yml +0 -0
  18. {python_hcl2-7.0.0 → python_hcl2-7.0.1}/LICENSE +0 -0
  19. {python_hcl2-7.0.0 → python_hcl2-7.0.1}/MANIFEST.in +0 -0
  20. {python_hcl2-7.0.0 → python_hcl2-7.0.1}/README.md +0 -0
  21. {python_hcl2-7.0.0 → python_hcl2-7.0.1}/bin/terraform_test +0 -0
  22. {python_hcl2-7.0.0 → python_hcl2-7.0.1}/hcl2/__init__.py +0 -0
  23. {python_hcl2-7.0.0 → python_hcl2-7.0.1}/hcl2/__main__.py +0 -0
  24. {python_hcl2-7.0.0 → python_hcl2-7.0.1}/hcl2/api.py +0 -0
  25. {python_hcl2-7.0.0 → python_hcl2-7.0.1}/hcl2/builder.py +0 -0
  26. {python_hcl2-7.0.0 → python_hcl2-7.0.1}/hcl2/parser.py +0 -0
  27. {python_hcl2-7.0.0 → python_hcl2-7.0.1}/hcl2/py.typed +0 -0
  28. {python_hcl2-7.0.0 → python_hcl2-7.0.1}/hcl2/reconstructor.py +0 -0
  29. {python_hcl2-7.0.0 → python_hcl2-7.0.1}/mypy.ini +0 -0
  30. {python_hcl2-7.0.0 → python_hcl2-7.0.1}/pylintrc +0 -0
  31. {python_hcl2-7.0.0 → python_hcl2-7.0.1}/pyproject.toml +0 -0
  32. {python_hcl2-7.0.0 → python_hcl2-7.0.1}/python_hcl2.egg-info/dependency_links.txt +0 -0
  33. {python_hcl2-7.0.0 → python_hcl2-7.0.1}/python_hcl2.egg-info/entry_points.txt +0 -0
  34. {python_hcl2-7.0.0 → python_hcl2-7.0.1}/python_hcl2.egg-info/not-zip-safe +0 -0
  35. {python_hcl2-7.0.0 → python_hcl2-7.0.1}/python_hcl2.egg-info/requires.txt +0 -0
  36. {python_hcl2-7.0.0 → python_hcl2-7.0.1}/python_hcl2.egg-info/top_level.txt +0 -0
  37. {python_hcl2-7.0.0 → python_hcl2-7.0.1}/reports/.gitignore +0 -0
  38. {python_hcl2-7.0.0 → python_hcl2-7.0.1}/requirements.txt +0 -0
  39. {python_hcl2-7.0.0 → python_hcl2-7.0.1}/setup.cfg +0 -0
  40. {python_hcl2-7.0.0 → python_hcl2-7.0.1}/test-requirements.txt +0 -0
  41. {python_hcl2-7.0.0 → python_hcl2-7.0.1}/tox.ini +0 -0
  42. {python_hcl2-7.0.0 → python_hcl2-7.0.1}/tree-to-hcl2-reconstruction.md +0 -0
@@ -0,0 +1,32 @@
1
+ ---
2
+ name: HCL2 parsing error
3
+ about: Template for reporting a bug related to parsing HCL2 code
4
+ title: ''
5
+ labels: bug
6
+ assignees: kkozik-amplify
7
+
8
+ ---
9
+
10
+ **Describe the bug**
11
+
12
+ A clear and concise description of what the bug is.
13
+
14
+ **Software:**
15
+ - OS: [macOS / Windows / Linux]
16
+ - Python version (e.g. 3.9.21)
17
+ - python-hcl2 version (e.g. 7.0.0)
18
+
19
+ **Snippet of HCL2 code causing the unexpected behaviour:**
20
+ ```terraform
21
+ locals {
22
+ foo = "bar"
23
+ }
24
+ ```
25
+ **Expected behavior**
26
+
27
+ A clear and concise description of what you expected to happen, e.g. python dictionary or JSON you expected to receive as a result of parsing.
28
+
29
+ **Exception traceback (if applicable)**:
30
+
31
+ ```
32
+ ```
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
6
6
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## \[7.0.1\] - 2025-03-31
9
+
10
+ ### Fixed
11
+
12
+ - Issue parsing dot-accessed attribute as an object key ([#209](https://github.com/amplify-education/python-hcl2/pull/209))
13
+
8
14
  ## \[7.0.0\] - 2025-03-27
9
15
 
10
16
  ### Added
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-hcl2
3
- Version: 7.0.0
3
+ Version: 7.0.1
4
4
  Summary: A parser for HCL2
5
5
  Author-email: Amplify Education <github@amplify.com>
6
6
  License: MIT
@@ -38,6 +38,7 @@ PLUS : "+"
38
38
  LPAR : "("
39
39
  RPAR : ")"
40
40
  COMMA : ","
41
+ DOT : "."
41
42
 
42
43
  expr_term : LPAR new_line_or_comment? expression new_line_or_comment? RPAR
43
44
  | float_lit
@@ -74,8 +75,8 @@ EQ : /[ \t]*=(?!=|>)/
74
75
  tuple : "[" (new_line_or_comment* expression new_line_or_comment* ",")* (new_line_or_comment* expression)? new_line_or_comment* "]"
75
76
  object : "{" new_line_or_comment? (new_line_or_comment* (object_elem | (object_elem COMMA)) new_line_or_comment*)* "}"
76
77
  object_elem : object_elem_key ( EQ | ":") expression
77
- object_elem_key : float_lit | int_lit | identifier | STRING_LIT
78
-
78
+ object_elem_key : float_lit | int_lit | identifier | STRING_LIT | object_elem_key_dot_accessor
79
+ object_elem_key_dot_accessor : identifier (DOT identifier)+
79
80
 
80
81
  heredoc_template : /<<(?P<heredoc>[a-zA-Z][a-zA-Z0-9._-]+)\n?(?:.|\n)*?\n\s*(?P=heredoc)\n/
81
82
  heredoc_template_trim : /<<-(?P<heredoc_trim>[a-zA-Z][a-zA-Z0-9._-]+)\n?(?:.|\n)*?\n\s*(?P=heredoc_trim)\n/
@@ -107,6 +107,9 @@ class DictTransformer(Transformer):
107
107
  value = self.to_string_dollar(value)
108
108
  return {key: value}
109
109
 
110
+ def object_elem_key_dot_accessor(self, args: List) -> str:
111
+ return "".join(args)
112
+
110
113
  def object(self, args: List) -> Dict:
111
114
  args = self.strip_new_line_tokens(args)
112
115
  result: Dict[str, Any] = {}
@@ -17,5 +17,5 @@ __version__: str
17
17
  __version_tuple__: VERSION_TUPLE
18
18
  version_tuple: VERSION_TUPLE
19
19
 
20
- __version__ = version = '7.0.0'
21
- __version_tuple__ = version_tuple = (7, 0, 0)
20
+ __version__ = version = '7.0.1'
21
+ __version_tuple__ = version_tuple = (7, 0, 1)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-hcl2
3
- Version: 7.0.0
3
+ Version: 7.0.1
4
4
  Summary: A parser for HCL2
5
5
  Author-email: Amplify Education <github@amplify.com>
6
6
  License: MIT
@@ -15,6 +15,7 @@ test-requirements.txt
15
15
  tox.ini
16
16
  tree-to-hcl2-reconstruction.md
17
17
  .github/CODEOWNERS
18
+ .github/ISSUE_TEMPLATE/hcl2-parsing-error.md
18
19
  .github/workflows/codeql-analysis.yml
19
20
  .github/workflows/pr_check.yml
20
21
  .github/workflows/publish.yml
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes