MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / parse_cargo

Method parse_cargo

misc/python/materialize/mz_version.py:107–119  ·  view source on GitHub ↗

Uses the cargo mz-environmentd package info to get the version of current source code state

(cls)

Source from the content-addressed store, hash-verified

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
122class MzCliVersion(TypedVersionBase):

Calls 2

ValueErrorClass · 0.85
parse_without_prefixMethod · 0.80

Tested by 5

base_versionMethod · 0.64
test_upgradeFunction · 0.64
executeMethod · 0.64
mainFunction · 0.64