Skip to content

Commit fff5205

Browse files
authored
update packages versions (#1717)
Co-authored-by: Haifeng Jin <haifeng-jin@users.noreply.github.com>
1 parent d435e05 commit fff5205

File tree

4 files changed

+25
-23
lines changed

4 files changed

+25
-23
lines changed

autokeras/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
from autokeras.utils.utils import check_kt_version
6666
from autokeras.utils.utils import check_tf_version
6767

68-
__version__ = "master"
68+
__version__ = "1.0.19dev"
6969

7070
check_tf_version()
7171
check_kt_version()

autokeras/utils/utils.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# limitations under the License.
1414

1515
import re
16+
import warnings
1617

1718
import keras_tuner
1819
import tensorflow as tf
@@ -37,27 +38,25 @@ def to_snake_case(name):
3738

3839
def check_tf_version() -> None:
3940
if parse(tf.__version__) < parse("2.7.0"):
40-
raise ImportError(
41+
warnings.warn(
4142
"The Tensorflow package version needs to be at least 2.7.0 \n"
4243
"for AutoKeras to run. Currently, your TensorFlow version is \n"
43-
"{version}. Please upgrade with \n"
44+
f"{tf.__version__}. Please upgrade with \n"
4445
"`$ pip install --upgrade tensorflow`. \n"
45-
"You can use `pip freeze` to check afterwards that everything is "
46-
"ok.".format(version=tf.__version__)
46+
"You can use `pip freeze` to check afterwards that everything is ok.",
47+
ImportWarning,
4748
)
4849

4950

5051
def check_kt_version() -> None:
51-
if keras_tuner.__version__ == "master":
52-
return
5352
if parse(keras_tuner.__version__) < parse("1.1.0"):
54-
raise ImportError(
53+
warnings.warn(
5554
"The Keras Tuner package version needs to be at least 1.1.0 \n"
5655
"for AutoKeras to run. Currently, your Keras Tuner version is \n"
57-
"{version}. Please upgrade with \n"
56+
f"{keras_tuner.__version__}. Please upgrade with \n"
5857
"`$ pip install --upgrade keras-tuner`. \n"
59-
"You can use `pip freeze` to check afterwards that everything is "
60-
"ok.".format(version=keras_tuner.__version__)
58+
"You can use `pip freeze` to check afterwards that everything is ok.",
59+
ImportWarning,
6160
)
6261

6362

@@ -71,7 +70,7 @@ def evaluate_with_adaptive_batch_size(model, batch_size, verbose=1, **fit_kwargs
7170
lambda x, validation_data, **kwargs: model.evaluate(
7271
x, verbose=verbose, **kwargs
7372
),
74-
**fit_kwargs
73+
**fit_kwargs,
7574
)
7675

7776

@@ -81,7 +80,7 @@ def predict_with_adaptive_batch_size(model, batch_size, verbose=1, **fit_kwargs)
8180
lambda x, validation_data, **kwargs: model.predict(
8281
x, verbose=verbose, **kwargs
8382
),
84-
**fit_kwargs
83+
**fit_kwargs,
8584
)
8685

8786

autokeras/utils/utils_test.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,27 @@ def test_validate_num_inputs_error():
3030
def test_check_tf_version_error():
3131
utils.tf.__version__ = "2.1.0"
3232

33-
with pytest.raises(ImportError) as info:
33+
with pytest.warns(ImportWarning) as record:
3434
utils.check_tf_version()
3535

36-
assert "Tensorflow package version needs to be at least" in str(info.value)
36+
assert len(record) == 1
37+
assert (
38+
"Tensorflow package version needs to be at least"
39+
in record[0].message.args[0]
40+
)
3741

3842

3943
def test_check_kt_version_error():
4044
utils.keras_tuner.__version__ = "1.0.0"
4145

42-
with pytest.raises(ImportError) as info:
46+
with pytest.warns(ImportWarning) as record:
4347
utils.check_kt_version()
4448

45-
assert "Keras Tuner package version needs to be at least" in str(info.value)
46-
47-
48-
def test_check_kt_version_master():
49-
utils.keras_tuner.__version__ = "master"
50-
utils.check_kt_version()
49+
assert len(record) == 1
50+
assert (
51+
"Keras Tuner package version needs to be at least"
52+
in record[0].message.args[0]
53+
)
5154

5255

5356
def test_run_with_adaptive_batch_size_raise_error():

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"tests": [
2727
"pytest>=4.4.0",
2828
"flake8",
29-
"black",
29+
"black==22.3.0",
3030
"isort",
3131
"pytest-xdist",
3232
"pytest-cov",

0 commit comments

Comments
 (0)