morphir-python 0.0.3__tar.gz → 0.1.0__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: morphir-python
3
- Version: 0.0.3
3
+ Version: 0.1.0
4
4
  Summary: CLI tools and extensions for Morphir Python
5
5
  Project-URL: Homepage, https://github.com/finos/morphir-python
6
6
  Project-URL: Documentation, https://morphir.finos.org
@@ -20,8 +20,8 @@ Classifier: Topic :: Software Development :: Code Generators
20
20
  Classifier: Topic :: Software Development :: Libraries
21
21
  Classifier: Typing :: Typed
22
22
  Requires-Python: >=3.14
23
- Requires-Dist: morphir-python-native==0.1.0
24
- Requires-Dist: morphir>=0.0.2
23
+ Requires-Dist: morphir-python-native==0.1.1
24
+ Requires-Dist: morphir>=0.1.0
25
25
  Requires-Dist: pygments>=2.20.0
26
26
  Requires-Dist: typer>=0.15
27
27
  Description-Content-Type: text/markdown
@@ -67,6 +67,7 @@ morphir-python ir inspect morphir-ir.json
67
67
  morphir-python ir convert morphir-ir.json --to v4 -o out.json --package-version 1.2.0
68
68
  morphir-python ir convert v4.json --to v3 -o out.json --drop-source-locations
69
69
  morphir-python ir convert old-format-1.json --to v3 -o out.json
70
+ morphir-python ir convert morphir-ir.json --to v4 --v4-spelling expanded -o out.json
70
71
  ```
71
72
 
72
73
  `inspect` prints the normalized format version, the distribution kind
@@ -75,6 +76,9 @@ draft and formats 1 and 2 as legacy. `convert` handles `Library` and `Specs` in
75
76
  both directions. It writes a v3 `Library` as format `3` and a v3 `Specs` as
76
77
  `"3.1.0"`, the lowest version that holds each. A legacy format 1 or 2 file
77
78
  converts to a format 3.0.0 `Library` or draft v4; nothing writes format 1 or 2.
79
+ Draft v4 is written in the compact canonical spelling, as other Morphir tools
80
+ write it; `--v4-spelling expanded` writes every node in the expanded form
81
+ instead. Both spellings read back to the same model.
78
82
  `convert` writes through a temporary file and renames it only on success, so a
79
83
  failed conversion leaves no output file.
80
84
  Diagnostics go to standard error as `code at location: message`.
@@ -87,7 +91,7 @@ format-version rules and the draft v4 status.
87
91
  ## Requirements
88
92
 
89
93
  - Python 3.14+
90
- - `morphir>=0.0.2` and `morphir-python-native==0.1.0` (installed as dependencies)
94
+ - `morphir>=0.1.0` and `morphir-python-native==0.1.1` (installed as dependencies)
91
95
 
92
96
  ## License
93
97
 
@@ -39,6 +39,7 @@ morphir-python ir inspect morphir-ir.json
39
39
  morphir-python ir convert morphir-ir.json --to v4 -o out.json --package-version 1.2.0
40
40
  morphir-python ir convert v4.json --to v3 -o out.json --drop-source-locations
41
41
  morphir-python ir convert old-format-1.json --to v3 -o out.json
42
+ morphir-python ir convert morphir-ir.json --to v4 --v4-spelling expanded -o out.json
42
43
  ```
43
44
 
44
45
  `inspect` prints the normalized format version, the distribution kind
@@ -47,6 +48,9 @@ draft and formats 1 and 2 as legacy. `convert` handles `Library` and `Specs` in
47
48
  both directions. It writes a v3 `Library` as format `3` and a v3 `Specs` as
48
49
  `"3.1.0"`, the lowest version that holds each. A legacy format 1 or 2 file
49
50
  converts to a format 3.0.0 `Library` or draft v4; nothing writes format 1 or 2.
51
+ Draft v4 is written in the compact canonical spelling, as other Morphir tools
52
+ write it; `--v4-spelling expanded` writes every node in the expanded form
53
+ instead. Both spellings read back to the same model.
50
54
  `convert` writes through a temporary file and renames it only on success, so a
51
55
  failed conversion leaves no output file.
52
56
  Diagnostics go to standard error as `code at location: message`.
@@ -59,7 +63,7 @@ format-version rules and the draft v4 status.
59
63
  ## Requirements
60
64
 
61
65
  - Python 3.14+
62
- - `morphir>=0.0.2` and `morphir-python-native==0.1.0` (installed as dependencies)
66
+ - `morphir>=0.1.0` and `morphir-python-native==0.1.1` (installed as dependencies)
63
67
 
64
68
  ## License
65
69
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "morphir-python"
3
- version = "0.0.3"
3
+ version = "0.1.0"
4
4
  description = "CLI tools and extensions for Morphir Python"
5
5
  readme = "README.md"
6
6
  license = "Apache-2.0"
@@ -22,9 +22,9 @@ authors = [
22
22
  { name = "FINOS", email = "morphir@finos.org" }
23
23
  ]
24
24
  dependencies = [
25
- "morphir>=0.0.2",
25
+ "morphir>=0.1.0",
26
26
  # Exact qualified native compiler; checked again when the compiler first loads.
27
- "morphir-python-native==0.1.0",
27
+ "morphir-python-native==0.1.1",
28
28
  "typer>=0.15",
29
29
  # Rich uses Pygments; older versions are affected by CVE-2026-4539.
30
30
  "pygments>=2.20.0",
@@ -6,8 +6,8 @@ Morphir domain models, including code generation and development tools.
6
6
  Example:
7
7
  >>> import morphir_tools
8
8
  >>> morphir_tools.__version__
9
- '0.0.3'
9
+ '0.1.0'
10
10
  """
11
11
 
12
- __version__ = "0.0.3"
12
+ __version__ = "0.1.0"
13
13
  __all__ = ["__version__"]
@@ -53,6 +53,13 @@ ir_app = typer.Typer(
53
53
  app.add_typer(ir_app, name="ir")
54
54
 
55
55
 
56
+ class V4Spelling(str, Enum):
57
+ """The draft v4 JSON spelling to write."""
58
+
59
+ COMPACT = "compact"
60
+ EXPANDED = "expanded"
61
+
62
+
56
63
  class Target(str, Enum):
57
64
  """The IR version to convert to."""
58
65
 
@@ -184,6 +191,14 @@ def convert(
184
191
  "writing v4, which spells an input as a bare type."
185
192
  ),
186
193
  ] = False,
194
+ v4_spelling: Annotated[
195
+ V4Spelling,
196
+ typer.Option(
197
+ "--v4-spelling",
198
+ help="The v4 JSON spelling to write: compact, the canonical form, or "
199
+ "expanded. Ignored when writing v3.",
200
+ ),
201
+ ] = V4Spelling.COMPACT,
187
202
  ) -> None:
188
203
  """Convert between format 3 (3.0.x and 3.1.x) and draft IR v4.
189
204
 
@@ -209,7 +224,9 @@ def convert(
209
224
  upgraded = Ok(migrated.value, migrated.warnings)
210
225
  if drop_input_attributes:
211
226
  upgraded = drop_inputs(upgraded.value)
212
- document = v4_codec.encode_versioned_distribution(upgraded.value)
227
+ document = v4_codec.encode_versioned_distribution(
228
+ upgraded.value, spelling=v4_codec.Spelling(v4_spelling.value)
229
+ )
213
230
  warnings: tuple[Diagnostic, ...] = upgraded.warnings
214
231
  else:
215
232
  if not _is_v4(version):
@@ -8,7 +8,7 @@ from typing import Protocol, cast
8
8
 
9
9
  from ._types import NativeCompilerInfo, NativeCompilerUnavailable
10
10
 
11
- EXPECTED_NATIVE_VERSION = "0.1.0"
11
+ EXPECTED_NATIVE_VERSION = "0.1.1"
12
12
  """The exact ``morphir-python-native`` version this release was qualified with.
13
13
 
14
14
  It must equal the pin in this distribution's ``pyproject.toml``.
File without changes