Skip to content

Commit 69cbb14

Browse files
committed
MAINT stricter dependency checks on import and install
1 parent 1094ed6 commit 69cbb14

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

autosklearn/__init__.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# -*- encoding: utf-8 -*-
2+
import os
3+
import sys
4+
25
from autosklearn.util import dependencies
36
from autosklearn.__version__ import __version__
47

@@ -13,3 +16,17 @@
1316
'''
1417

1518
dependencies.verify_packages(__MANDATORY_PACKAGES__)
19+
20+
if os.name != 'posix':
21+
raise ValueError(
22+
'Detected unsupported operating system: %s. Please check '
23+
'the compability information of auto-sklearn: http://automl.github.io'
24+
'/auto-sklearn/stable/installation.html#windows-osx-compability' %
25+
sys.platform
26+
)
27+
28+
if sys.version_info < (3, 5):
29+
raise ValueError(
30+
'Unsupported python version %s found. Auto-sklearn requires Python '
31+
'3.5 or higher.' % sys.version_info
32+
)

setup.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
import os
77
import sys
88

9+
10+
# Check if Auto-sklearn *could* run on the given system
911
if os.name != 'posix':
1012
raise ValueError(
1113
'Detected unsupported operating system: %s. Please check '
@@ -14,6 +16,13 @@
1416
sys.platform
1517
)
1618

19+
if sys.version_info < (3, 5):
20+
raise ValueError(
21+
'Unsupported python version %s found. Auto-sklearn requires Python '
22+
'3.5 or higher.' % sys.version_info
23+
)
24+
25+
1726
extensions = cythonize(
1827
[Extension('autosklearn.data.competition_c_functions',
1928
sources=['autosklearn/data/competition_c_functions.pyx'],

test/test_automl/test_automl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def test_refit_shuffle_on_fail(self):
5353
auto = AutoML(backend, 20, 5)
5454
ensemble_mock = unittest.mock.Mock()
5555
auto.ensemble_ = ensemble_mock
56-
ensemble_mock.get_model_identifiers.return_value = [1]
56+
ensemble_mock.get_selected_model_identifiers.return_value = [1]
5757

5858
auto.models_ = {1: failing_model}
5959

0 commit comments

Comments
 (0)