from pathlib import Path
import json,sys
root=Path(__file__).resolve().parent/'working'/'polyglot'; mode=sys.argv[1]
if mode=='remove-python-artifact':
    wheels=list((root/'python'/'wheelhouse').glob('*.whl'))
    if not wheels: raise SystemExit('no wheel to remove')
    wheels[0].unlink()
elif mode=='tool-expectation-drift':
    p=root/'closure_config.json'; d=json.load(open(p)); d['tool_expectations']['node']='0.0.0-impossible'; p.write_text(json.dumps(d,indent=2)+'\n')
elif mode=='lock-drift':
    p=root/'python'/'pyproject.toml'; t=p.read_text(); p.write_text(t.replace('demo-dep==1.0.0','demo-dep==2.0.0'))
else: raise SystemExit('remove-python-artifact | tool-expectation-drift | lock-drift')
print(mode)
