@@ -28,6 +28,10 @@ def publish_plan(release_version: str, host_version: str) -> list[tuple[str, str
2828 return [(package , versions [package ]) for package in PACKAGE_ORDER ]
2929
3030
31+ def yank_command (package : str , version : str ) -> list [str ]:
32+ return ["cargo" , "yank" , "--vers" , version , package ]
33+
34+
3135def _rewrite_dependency_versions (text : str , versions : dict [str , str ]) -> str :
3236 dependency_re = re .compile (r"^(\s*([A-Za-z0-9_-]+)\s*=\s*\{)(.*)(\}\s*)$" )
3337 output = []
@@ -156,6 +160,7 @@ def main() -> None:
156160 parser .add_argument ("--host-version" , default = "0.22.7" )
157161 parser .add_argument ("--root" , type = Path , default = Path .cwd ())
158162 parser .add_argument ("--prepare-only" , action = "store_true" )
163+ parser .add_argument ("--yank-host-version" )
159164 args = parser .parse_args ()
160165
161166 root = args .root .resolve ()
@@ -167,6 +172,13 @@ def main() -> None:
167172 if not os .environ .get ("CARGO_REGISTRY_TOKEN" ):
168173 raise SystemExit ("CARGO_REGISTRY_TOKEN is required" )
169174
175+ if args .yank_host_version :
176+ subprocess .run (
177+ yank_command ("pd-host-function" , args .yank_host_version ),
178+ cwd = root ,
179+ check = True ,
180+ )
181+
170182 for package , version in plan :
171183 if crate_exists (package , version ):
172184 print (f"{ package } { version } already published; skipping" , flush = True )
0 commit comments