Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
BooleanOptionalAction
  • Loading branch information
youknowone committed Jan 20, 2026
commit b295586ff9f9cd39248859bdbbc7eacbce25838e
11 changes: 6 additions & 5 deletions scripts/update_lib/auto_mark.py
Original file line number Diff line number Diff line change
Expand Up @@ -675,21 +675,22 @@ def main(argv: list[str] | None = None) -> int:
help="Also add @expectedFailure to failing tests (default: only remove unexpected successes)",
)
parser.add_argument(
"--skip-build",
action="store_true",
help="Skip cargo build, use pre-built binary",
"--build",
action=argparse.BooleanOptionalAction,
default=True,
help="Build with cargo (default: enabled)",
)

args = parser.parse_args(argv)

try:
if args.path.is_dir():
num_added, num_removed, _ = auto_mark_directory(
args.path, mark_failure=args.mark_failure, skip_build=args.skip_build
args.path, mark_failure=args.mark_failure, skip_build=not args.build
)
else:
num_added, num_removed, _ = auto_mark_file(
args.path, mark_failure=args.mark_failure, skip_build=args.skip_build
args.path, mark_failure=args.mark_failure, skip_build=not args.build
)
if args.mark_failure:
print(f"Added expectedFailure to {num_added} tests")
Expand Down
46 changes: 25 additions & 21 deletions scripts/update_lib/quick.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,41 +271,45 @@ def main(argv: list[str] | None = None) -> int:
help="Source path (file or directory)",
)
parser.add_argument(
"--no-copy",
action="store_true",
help="Skip copy-lib step (implied if path is a test path)",
"--copy",
action=argparse.BooleanOptionalAction,
default=True,
help="Copy library file (default: enabled, implied disabled if test path)",
)
parser.add_argument(
"--no-migrate",
action="store_true",
help="Skip migration step (implied if path starts with Lib/)",
"--migrate",
action=argparse.BooleanOptionalAction,
default=True,
help="Migrate test file (default: enabled, implied disabled if Lib/ path)",
)
parser.add_argument(
"--no-auto-mark",
action="store_true",
help="Skip auto-mark step",
"--auto-mark",
action=argparse.BooleanOptionalAction,
default=True,
help="Auto-mark test failures (default: enabled)",
)
parser.add_argument(
"--mark-failure",
action="store_true",
help="Add @expectedFailure to failing tests",
)
parser.add_argument(
"--no-commit",
action="store_true",
help="Skip git commit step",
"--commit",
action=argparse.BooleanOptionalAction,
default=True,
help="Create git commit (default: enabled)",
)
parser.add_argument(
"--skip-build",
action="store_true",
help="Skip cargo build, use pre-built binary",
"--build",
action=argparse.BooleanOptionalAction,
default=True,
help="Build with cargo (default: enabled)",
)

args = parser.parse_args(argv)

try:
src_path = args.path
no_copy = args.no_copy

# Shortcut: expand simple name to cpython/Lib path
src_path = _expand_shortcut(src_path)
Expand All @@ -320,7 +324,7 @@ def main(argv: list[str] | None = None) -> int:
# Get library destination path for commit
lib_file_path = parse_lib_path(src_path)

if not no_copy:
if args.copy:
from update_lib.copy_lib import copy_lib

copy_lib(src_path)
Expand All @@ -336,14 +340,14 @@ def main(argv: list[str] | None = None) -> int:
# Process the test path
quick(
src_path,
no_migrate=args.no_migrate,
no_auto_mark=args.no_auto_mark,
no_migrate=not args.migrate,
no_auto_mark=not args.auto_mark,
mark_failure=args.mark_failure,
skip_build=args.skip_build,
skip_build=not args.build,
)

# Step 3: Git commit
if not args.no_commit:
if args.commit:
# Extract module name from path
name = original_src.stem
if name == "__init__":
Expand Down
Loading