Simplify soft dependencies and update the dummy-creation process (#36827)
* Reverse dependency map shouldn't be created when test_all is set * [test_all] Remove dummies * Modular fixes * Update utils/check_repo.py Co-authored-by: Pablo Montalvo <39954772+molbap@users.noreply.github.com> * [test_all] Better docs * [test_all] Update src/transformers/commands/chat.py Co-authored-by: Joao Gante <joaofranciscocardosogante@gmail.com> * [test_all] Remove deprecated AdaptiveEmbeddings from the tests * [test_all] Doc builder * [test_all] is_dummy * [test_all] Import utils * [test_all] Doc building should not require all deps --------- Co-authored-by: Pablo Montalvo <39954772+molbap@users.noreply.github.com> Co-authored-by: Joao Gante <joaofranciscocardosogante@gmail.com>
This commit is contained in:
@@ -279,25 +279,6 @@ def analyze_results(import_dict_objects: Dict[str, List[str]], type_hint_objects
|
||||
return errors
|
||||
|
||||
|
||||
def check_all_inits():
|
||||
"""
|
||||
Check all inits in the transformers repo and raise an error if at least one does not define the same objects in
|
||||
both halves.
|
||||
"""
|
||||
failures = []
|
||||
for root, _, files in os.walk(PATH_TO_TRANSFORMERS):
|
||||
if "__init__.py" in files:
|
||||
fname = os.path.join(root, "__init__.py")
|
||||
objects = parse_init(fname)
|
||||
if objects is not None:
|
||||
errors = analyze_results(*objects)
|
||||
if len(errors) > 0:
|
||||
errors[0] = f"Problem in {fname}, both halves do not define the same objects.\n{errors[0]}"
|
||||
failures.append("\n".join(errors))
|
||||
if len(failures) > 0:
|
||||
raise ValueError("\n\n".join(failures))
|
||||
|
||||
|
||||
def get_transformers_submodules() -> List[str]:
|
||||
"""
|
||||
Returns the list of Transformers submodules.
|
||||
@@ -370,5 +351,5 @@ def check_submodules():
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
check_all_inits()
|
||||
check_submodules()
|
||||
# This entire files needs an overhaul
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user