MCPcopy Index your code
hub / github.com/RustPython/RustPython / quick

Function quick

scripts/update_lib/cmd_quick.py:76–184  ·  view source on GitHub ↗

Process a file or directory: migrate + auto-mark. Args: src_path: Source path (file or directory) no_migrate: Skip migration step no_auto_mark: Skip auto-mark step mark_failure: Add @expectedFailure to ALL failing tests verbose: Print progress messag

(
    src_path: pathlib.Path,
    no_migrate: bool = False,
    no_auto_mark: bool = False,
    mark_failure: bool = False,
    verbose: bool = True,
    skip_build: bool = False,
)

Source from the content-addressed store, hash-verified

74
75
76def quick(
77 src_path: pathlib.Path,
78 no_migrate: bool = False,
79 no_auto_mark: bool = False,
80 mark_failure: bool = False,
81 verbose: bool = True,
82 skip_build: bool = False,
83) -> list[pathlib.Path]:
84 """
85 Process a file or directory: migrate + auto-mark.
86
87 Args:
88 src_path: Source path (file or directory)
89 no_migrate: Skip migration step
90 no_auto_mark: Skip auto-mark step
91 mark_failure: Add @expectedFailure to ALL failing tests
92 verbose: Print progress messages
93 skip_build: Skip cargo build, use pre-built binary
94
95 Returns:
96 List of extra paths (data dirs, hard deps) that were copied/migrated.
97 """
98 from update_lib.cmd_auto_mark import auto_mark_directory, auto_mark_file
99 from update_lib.cmd_migrate import patch_directory, patch_file
100
101 extra_paths: list[pathlib.Path] = []
102
103 # Determine lib_path and whether to migrate
104 if is_lib_path(src_path):
105 no_migrate = True
106 lib_path = src_path
107 else:
108 lib_path = parse_lib_path(src_path)
109
110 is_dir = src_path.is_dir()
111
112 # Capture original test methods before migration (for smart auto-mark)
113 original_methods = collect_original_methods(lib_path)
114
115 # Step 1: Migrate
116 if not no_migrate:
117 if is_dir:
118 patch_directory(src_path, lib_path, verbose=verbose)
119 else:
120 patch_file(src_path, lib_path, verbose=verbose)
121
122 # Step 1.5: Handle test dependencies
123 from update_lib.deps import get_test_dependencies
124
125 test_deps = get_test_dependencies(src_path)
126
127 # Migrate dependency files
128 for dep_src in test_deps["hard_deps"]:
129 dep_lib = parse_lib_path(dep_src)
130 if verbose:
131 print(f"Migrating dependency: {dep_src.name}")
132 if dep_src.is_dir():
133 patch_directory(dep_src, dep_lib, verbose=False)

Callers 1

mainFunction · 0.85

Calls 14

is_lib_pathFunction · 0.90
parse_lib_pathFunction · 0.90
patch_directoryFunction · 0.90
patch_fileFunction · 0.90
get_test_dependenciesFunction · 0.90
auto_mark_directoryFunction · 0.90
auto_mark_fileFunction · 0.90
collect_original_methodsFunction · 0.85
printFunction · 0.50
is_dirMethod · 0.45
appendMethod · 0.45
existsMethod · 0.45

Tested by

no test coverage detected