Skip to content

Commit bfe2f0d

Browse files
committed
Disable timeouts.yml checks
1 parent 77f7664 commit bfe2f0d

File tree

3 files changed

+23
-11
lines changed

3 files changed

+23
-11
lines changed

.internal/pre_commit_tools/notebook_pre_commit_collection.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
DEFAULT_TIMEOUT_SECONDS: float = 20
1717

18+
ENFORCE_TIMEOUTS: bool = False
19+
1820

1921
def main(full_file_paths: Iterable[str]) -> bool:
2022
return validate_unique_names() and all(map(is_valid_notebook, full_file_paths))
@@ -39,7 +41,11 @@ def is_valid_notebook(file_path: str, automatically_add_timeout: bool = True) ->
3941
f" for example, you may change '{file_path}' to '{file_path.replace(' ', '_')}'."
4042
)
4143

42-
if not _is_file_in_timeouts(file_name) and should_notebook_be_tested(file_path):
44+
if (
45+
ENFORCE_TIMEOUTS
46+
and not _is_file_in_timeouts(file_name)
47+
and should_notebook_be_tested(file_path)
48+
):
4349
if automatically_add_timeout:
4450
_add_file_to_timeouts(file_name)
4551
errors.append(

.internal/pre_commit_tools/qmod_pre_commit_collection.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
DEFAULT_TIMEOUT_SECONDS: float = 10
1717

18+
ENFORCE_TIMEOUTS: bool = False
19+
1820

1921
def main(full_file_paths: Iterable[str]) -> bool:
2022
return validate_unique_names() and all(map(is_valid_qmod, full_file_paths))
@@ -43,7 +45,11 @@ def is_valid_qmod(
4345
f" for example, you may change '{file_path}' to '{file_path.replace(' ', '_')}'."
4446
)
4547

46-
if not _is_file_in_timeouts(file_name) and should_notebook_be_tested(file_path):
48+
if (
49+
ENFORCE_TIMEOUTS
50+
and not _is_file_in_timeouts(file_name)
51+
and should_notebook_be_tested(file_path)
52+
):
4753
if automatically_add_timeout:
4854
_add_file_to_timeouts(file_name)
4955
errors.append(

.pre-commit-config.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,15 @@ repos:
7777
additional_dependencies:
7878
- "pyyaml==6.0"
7979
require_serial: true
80-
- id: clean-demo-timeouts
81-
name: Clean demo timeouts
82-
description: Remove unexisting entries and verify unique keys
83-
entry: .internal/pre_commit_tools/clean_timeouts.py
84-
language: python
85-
files: ^\S+\.(qmod|ipynb|yaml)$
86-
additional_dependencies:
87-
- "pyyaml==6.0"
88-
require_serial: true
80+
# - id: clean-demo-timeouts
81+
# name: Clean demo timeouts
82+
# description: Remove unexisting entries and verify unique keys
83+
# entry: .internal/pre_commit_tools/clean_timeouts.py
84+
# language: python
85+
# files: ^\S+\.(qmod|ipynb|yaml)$
86+
# additional_dependencies:
87+
# - "pyyaml==6.0"
88+
# require_serial: true
8989
- id: auto-add-tests
9090
name: Auto add test
9191
description: Automatically adding a test to new notebooks

0 commit comments

Comments
 (0)