[minor][tune] Support Type Hinting for py3 (#6571)

* fullargspec for new pyversion

* fi
This commit is contained in:
Richard Liaw
2019-12-25 08:15:33 +01:00
committed by GitHub
parent cfb5934c62
commit aa7b861332
2 changed files with 6 additions and 2 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ FROM ray-project/base-deps
# a test runner.
RUN conda install -y numpy
RUN pip install -U pip
RUN pip install -U https://ray-wheels.s3-us-west-2.amazonaws.com/latest/ray-0.9.0.dev-cp36-cp36m-manylinux1_x86_64.whl
RUN pip install -U https://ray-wheels.s3-us-west-2.amazonaws.com/latest/ray-0.9.0.dev0-cp36-cp36m-manylinux1_x86_64.whl
RUN pip install -U boto3
# We install this after the latest wheels -- this should not override the latest wheels.
# Needed to run Tune example with a 'plot' call - which does not actually render a plot, but throws an error.
+5 -1
View File
@@ -7,6 +7,7 @@ import time
import inspect
import threading
import traceback
import sys
from six.moves import queue
from ray.tune import track
@@ -248,7 +249,10 @@ def wrap_function(train_func):
use_track = False
try:
func_args = inspect.getargspec(train_func).args
if sys.version_info >= (3, 3):
func_args = inspect.getfullargspec(train_func).args
else:
func_args = inspect.getargspec(train_func).args
use_track = ("reporter" not in func_args and len(func_args) == 1)
if use_track:
logger.info("tune.track signature detected.")