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

Function update_downstream_versions

dev/update_datafusion_versions.py:91–110  ·  view source on GitHub ↗
(cargo_toml: str, new_version: str)

Source from the content-addressed store, hash-verified

89 f.write(tomlkit.dumps(doc))
90
91def update_downstream_versions(cargo_toml: str, new_version: str):
92 with open(cargo_toml) as f:
93 data = f.read()
94
95 doc = tomlkit.parse(data)
96
97 for crate in crates.keys():
98 df_dep = doc.get('dependencies', {}).get(crate)
99 # skip crates that pin datafusion using git hash
100 if df_dep is not None and df_dep.get('version') is not None:
101 print(f'updating {crate} dependency in {cargo_toml}')
102 df_dep['version'] = new_version
103
104 df_dep = doc.get('dev-dependencies', {}).get(crate)
105 if df_dep is not None and df_dep.get('version') is not None:
106 print(f'updating {crate} dev-dependency in {cargo_toml}')
107 df_dep['version'] = new_version
108
109 with open(cargo_toml, 'w') as f:
110 f.write(tomlkit.dumps(doc))
111
112
113def update_docs(path: 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…