Skip to content

Commit

Permalink
Drops support for python 3.6 (#726)
Browse files Browse the repository at this point in the history
* Drop python 3.6

* Relax unit test

* Relax unit test (correctly)
  • Loading branch information
franchuterivera authored Jun 25, 2021
1 parent 84960ee commit 0677f30
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-18.04
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
python-version: [3.7, 3.8, 3.9]
use-conda: [true, false]
use-dist: [false]
include:
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,15 @@ we refer to
In: Proceedings of the conference on Learning and Intelligent OptimizatioN (LION 5)


SMAC v3 is written in Python3 and continuously tested with Python 3.6 and
python3.6. Its [Random Forest](https://github.com/automl/random_forest_run)
is written in C++.
SMAC v3 is written in Python3 and continuously tested with Python 3.7, 3.8 and 3.9.
Its [Random Forest](https://github.com/automl/random_forest_run) is written in C++.

# Installation

## Requirements

Besides the listed requirements (see `requirements.txt`), the random forest
used in SMAC3 requires SWIG (>= 3.0, <4.0) as a build dependency:
used in SMAC3 requires SWIG as a build dependency:

```apt-get install swig```

Expand Down
2 changes: 1 addition & 1 deletion doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Contents:
| howpublished={\\url{https://github.com/automl/SMAC3}}
| }
SMAC3 is mainly written in Python 3 and continuously tested with Python 3.6-3.8.
SMAC3 is mainly written in Python 3 and continuously tested with Python 3.7-3.9.
Its `Random Forest <https://github.com/automl/random_forest_run>`_ is written in
C++11.

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def get_author():


setup(
python_requires=">=3.6",
python_requires=">=3.7",
install_requires=requirements,
extras_require=extras_require,
package_data={'smac': ['requirements.txt', 'extras_require.json']},
Expand Down
4 changes: 2 additions & 2 deletions smac/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
package_name = 'skopt'
lazy_import.lazy_module(package_name)

if sys.version_info < (3, 6, 0):
raise ValueError("SMAC requires Python 3.6.0 or newer.")
if sys.version_info < (3, 7, 0):
raise ValueError("SMAC requires Python 3.7.0 or newer.")


if os.name != 'posix':
Expand Down
5 changes: 4 additions & 1 deletion test/test_epm/test_rf_with_instances.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,10 @@ def test_rf_on_sklearn_data(self):
model.train(X_train, y_train)
y_hat, mu_hat = model.predict(X_test)
mae = np.mean(np.abs(y_hat - y_test), dtype=np.float128)
self.assertAlmostEqual(mae, maes[i], msg=('Do log: %s, iteration %i' % (str(do_log), i)))
self.assertAlmostEqual(mae, maes[i], msg=('Do log: %s, iteration %i' % (str(do_log), i)),
# We observe a difference of around 0.00017
# in github actions if doing log
places=3 if do_log else 7)

def test_impute_inactive_hyperparameters(self):
cs = smac.configspace.ConfigurationSpace()
Expand Down
2 changes: 0 additions & 2 deletions test/test_smbo/test_smbo.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import shutil
import sys
import time
import unittest
from unittest import mock
Expand Down Expand Up @@ -278,7 +277,6 @@ def test_no_initial_design(self):
smbo.start()
self.assertEqual(smbo.initial_design_configs[0], smbo.scenario.cs.get_default_configuration())

@unittest.skipIf(sys.version_info < (3, 6), 'distributed requires Python >=3.6')
def test_ta_integration_to_smbo(self):
"""
In SMBO. 3 objects need to actively comunicate:
Expand Down
2 changes: 0 additions & 2 deletions test/test_tae/test_parallel_runner.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os
import sys
import tempfile
import time
import unittest
Expand Down Expand Up @@ -29,7 +28,6 @@ def target_delayed(x, seed, instance):
return x ** 2, {'key': seed, 'instance': instance}


@unittest.skipIf(sys.version_info < (3, 6), 'distributed requires Python >=3.6')
class TestDaskRunner(unittest.TestCase):

def setUp(self):
Expand Down

0 comments on commit 0677f30

Please sign in to comment.