MCPcopy Create free account
hub / github.com/apache/datafusion / update_workspace_version

Function update_workspace_version

dev/update_datafusion_versions.py:53–75  ·  view source on GitHub ↗
(new_version: str)

Source from the content-addressed store, hash-verified

51}
52
53def update_workspace_version(new_version: str):
54 cargo_toml = 'Cargo.toml'
55 print(f'updating {cargo_toml}')
56 with open(cargo_toml) as f:
57 data = f.read()
58
59 doc = tomlkit.parse(data)
60 pkg = doc.get('workspace').get('package')
61
62 print('workspace package', pkg)
63 pkg['version'] = new_version
64
65 doc = tomlkit.parse(data)
66
67 for crate in crates.keys():
68 df_dep = doc.get('workspace').get('dependencies', {}).get(crate)
69 # skip crates that pin datafusion using git hash
70 if df_dep is not None and df_dep.get('version') is not None:
71 print(f'updating {crate} dependency in {cargo_toml}')
72 df_dep['version'] = new_version
73
74 with open(cargo_toml, 'w') as f:
75 f.write(tomlkit.dumps(doc))
76
77
78def update_datafusion_version(cargo_toml: str, new_version: str):

Callers 1

mainFunction · 0.85

Calls 4

readMethod · 0.80
parseMethod · 0.45
getMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…