Skip to content

Commit c03fd8d

Browse files
marcenacpThe TensorFlow Datasets Authors
authored andcommitted
Use built-in prompt instead of click.confirm to remove dependency.
PiperOrigin-RevId: 692173947
1 parent 54dcd16 commit c03fd8d

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@
6363
# platform except 'x86_64'. See
6464
# https://github.com/google/array_record/issues/71
6565
'array_record>=0.5.0;platform_system=="Linux"',
66-
'click',
6766
'dm-tree',
6867
'etils[edc,enp,epath,epy,etree]>=1.6.0;python_version<"3.11"',
6968
'etils[edc,enp,epath,epy,etree]>=1.9.1;python_version>="3.11"',

tensorflow_datasets/core/split_builder.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
from etils import epath
2929
from etils import epy
3030
from tensorflow_datasets.core.utils.lazy_imports_utils import apache_beam as beam
31-
from tensorflow_datasets.core.utils.lazy_imports_utils import click
3231
from tensorflow_datasets.core.utils.lazy_imports_utils import psutil
3332

3433
with epy.lazy_imports():
@@ -341,13 +340,14 @@ def beam_pipeline(self) -> 'beam.Pipeline':
341340

342341
total_memory = psutil.virtual_memory().total
343342
if self._dataset_size >= total_memory:
344-
if not click.confirm(
343+
value = input(
345344
(
346345
f'The dataset is {self._dataset_size} in size, but your machine'
347346
f' has only {utils.Size(total_memory)} of memory. Continue?'
347+
'[Y/n] > '
348348
),
349-
default=True,
350-
):
349+
)
350+
if value.lower() in ('n', 'no'):
351351
sys.exit(1)
352352

353353
beam_options = (

tensorflow_datasets/core/utils/lazy_imports_utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ def datasets_error_callback(module_name: Exception):
109109

110110
with epy.lazy_imports():
111111
import apache_beam
112-
import click
113112
import pandas
114113
import psutil
115114
import pyarrow

0 commit comments

Comments
 (0)