ED_LRR/rust/cargo_check.py
2020-06-18 12:31:25 +02:00

19 lines
480 B
Python

import toml
import subprocess as SP
import os
def set_version(rev=None):
with open("Cargo.toml") as fh:
cargo = toml.loads(fh.read())
cargo["dependencies"]["pyo3"]["rev"] = rev
if rev is None:
del cargo["dependencies"]["pyo3"]["rev"]
with open("Cargo.toml", "w") as fh:
toml.dump(cargo, fh)
for commit in open("ch.txt").readlines():
set_version(commit.strip())
if os.system("cargo check") == 0:
break