Skip to content

Commit

Permalink
Add back Python 2 support and run tests in Python 2 and 3 (keras-team…
Browse files Browse the repository at this point in the history
…#179)

* Run integration tests in Py2 and 3

* Just run TF2 tests

* Just run TF2 tests

* Just run TF2 tests

* Just run TF2 tests

* Just run TF2 tests

* Just run TF2 tests

* Remove Pathlib

* Just run TF2 tests

* Just run TF2 tests

* Py2 fixes

* Dont build docs

* Fix

* Fix

* Fix doc

* Fix doc

* Fix imports

* Fix docstrings

* Fix LocalPath error

* Fix engine tests

* Use six.string_types, six.integer_types

* Fix flake8

* Fix failing integration test

* Change setup.py

* Test fixes

* Skip failing Py 2 tests

* Fix Fixed instance checks

* Reduce test flakiness
  • Loading branch information
omalleyt12 authored Dec 12, 2019
1 parent eea61d2 commit 91fe478
Show file tree
Hide file tree
Showing 24 changed files with 216 additions and 411 deletions.
28 changes: 13 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
dist: trusty
language: python
python:
- "2.7"
- "3.6"
env:
TRAVIS=True
matrix:
include:
- python: 3.6
env: TEST_MODE=INTEGRATION_TESTS
- python: 3.6
env: TEST_MODE=FLAKE8
- python: 3.6
env: TEST_MODE=TF2
- TRAVIS=True TEST_MODE=INTEGRATION_TESTS
- TRAVIS=True TEST_MODE=FLAKE8
- TRAVIS=True TEST_MODE=TF2
install:
# code below is taken from http://conda.pydata.org/docs/travis.html
# code below is taken from https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/use-conda-with-travis-ci.html
# We do this conditionally because it saves us some downloading if the
# version is the same.
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh;
else
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
fi
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- hash -r
Expand All @@ -35,17 +36,14 @@ install:
# install portpicker for mock distribution framework.
- travis_retry conda install portpicker

# install tools for building the docs
- pip install mkdocs keras-autodoc==0.4.0

- pip install -e .[tests] --progress-bar off

# command to run tests
script:
- if [[ "$TEST_MODE" == "INTEGRATION_TESTS" ]]; then
PYTHONPATH=$PWD:$PYTHONPATH py.test tests/integration_tests;
elif [[ "$TEST_MODE" == "FLAKE8" ]]; then
flake8 && cd docs && python autogen.py && mkdocs build;
flake8;
else
PYTHONPATH=$PWD:$PYTHONPATH py.test tests/kerastuner --cov-config .coveragerc --cov=kerastuner;
fi
28 changes: 14 additions & 14 deletions kerastuner/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@
from __future__ import division
from __future__ import print_function

from kerastuner import applications
from kerastuner import oracles
from kerastuner import tuners
from . import applications
from . import oracles
from . import tuners

from kerastuner.engine.hyperparameters import HyperParameters
from kerastuner.engine.hyperparameters import HyperParameter
from kerastuner.engine.hypermodel import HyperModel
from kerastuner.engine.tuner import Tuner
from kerastuner.engine.oracle import Objective
from kerastuner.engine.oracle import Oracle
from kerastuner.engine.logger import Logger
from kerastuner.engine.logger import CloudLogger
from kerastuner.tuners import BayesianOptimization
from kerastuner.tuners import Hyperband
from kerastuner.tuners import RandomSearch
from .engine.hyperparameters import HyperParameters
from .engine.hyperparameters import HyperParameter
from .engine.hypermodel import HyperModel
from .engine.tuner import Tuner
from .engine.oracle import Objective
from .engine.oracle import Oracle
from .engine.logger import Logger
from .engine.logger import CloudLogger
from .tuners import BayesianOptimization
from .tuners import Hyperband
from .tuners import RandomSearch

__version__ = '1.0.0'
1 change: 0 additions & 1 deletion kerastuner/abstractions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@
from __future__ import division
from __future__ import print_function

from .host import Host
from .display import IS_NOTEBOOK
299 changes: 0 additions & 299 deletions kerastuner/abstractions/host.py

This file was deleted.

Loading

0 comments on commit 91fe478

Please sign in to comment.