Skip to content

Commit f8a7d39

Browse files
committed
Fix check_doc_unreleased_version for macOS
1 parent a802ccb commit f8a7d39

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

run_release.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import shutil
1919
import subprocess
2020
import sys
21+
import tempfile
2122
import time
2223
import urllib.request
2324
from pathlib import Path
@@ -570,17 +571,14 @@ def check_doc_unreleased_version(db: ReleaseShelf) -> None:
570571
if release_tag.includes_docs:
571572
assert archive_path.exists()
572573
if archive_path.exists():
573-
proc = subprocess.run(
574-
[
575-
"tar",
576-
"-xjf",
577-
archive_path,
578-
'--to-command=! grep -Hn --label="$TAR_FILENAME" "[(]unreleased[)]"',
579-
],
580-
)
581-
if proc.returncode != 0:
582-
if not ask_question("Are these `(unreleased)` strings in built docs OK?"):
583-
raise AssertionError("`(unreleased)` strings found in docs")
574+
with tempfile.TemporaryDirectory() as temp_dir:
575+
subprocess.run(["tar", "-xjf", archive_path, "-C", temp_dir])
576+
proc = subprocess.run(["grep", "-rHn", "[(]unreleased[)]", temp_dir])
577+
if proc.returncode == 0:
578+
if not ask_question(
579+
"Are these `(unreleased)` strings in built docs OK?"
580+
):
581+
raise AssertionError("`(unreleased)` strings found in docs")
584582

585583

586584
def sign_source_artifacts(db: ReleaseShelf) -> None:

0 commit comments

Comments
 (0)