Uses the cargo mz-environmentd package info to get the version of current source code state
(cls)
| 105 | |
| 106 | @classmethod |
| 107 | def parse_cargo(cls) -> MzVersion: |
| 108 | """Uses the cargo mz-environmentd package info to get the version of current source code state""" |
| 109 | metadata = json.loads( |
| 110 | subprocess.check_output( |
| 111 | ["cargo", "metadata", "--no-deps", "--format-version=1"], |
| 112 | cwd=MZ_ROOT, |
| 113 | ) |
| 114 | ) |
| 115 | for package in metadata["packages"]: |
| 116 | if package["name"] == "mz-environmentd": |
| 117 | return cls.parse_without_prefix(package["version"]) |
| 118 | else: |
| 119 | raise ValueError("No mz-environmentd version found in cargo metadata") |
| 120 | |
| 121 | |
| 122 | class MzCliVersion(TypedVersionBase): |