Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove remaining __future__ imports. #6825

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
72b1a12
Remove remaining __future__ imports.
sven1977 Jan 18, 2020
0b5fb29
Attempt to increase sleep time from 5s to 10s in test_env_with_subpro…
sven1977 Jan 19, 2020
fad96fc
Move future print function back into determine_tests_to_run.py (break…
sven1977 Jan 21, 2020
f8ea44c
Set all envs in .travis.yml to PYTHON=3.5.
sven1977 Jan 21, 2020
854a526
python version test
sven1977 Jan 21, 2020
8b7d8e3
Test python 3.6 hint in .travis.yml file.
sven1977 Jan 21, 2020
67f3d00
Print out actual py version in install-dependencies.sh
sven1977 Jan 21, 2020
81c52a3
Retire py version checks in travis-run sh scripts. Set language=pytho…
sven1977 Jan 21, 2020
4964f0f
Remove future import again from determine_tests_to_run.py.
sven1977 Jan 21, 2020
583a50c
Remove future import again from determine_tests_to_run.py.
sven1977 Jan 21, 2020
c56fc50
Move py3.5 definition to head of travis file and remove all obsolete …
sven1977 Jan 21, 2020
32ffc48
Add flake8 pip install to travis.
sven1977 Jan 21, 2020
114a813
Rearrange if-blocks in install-dependencies.sh and remove flake8 inst…
sven1977 Jan 21, 2020
f26ac0b
Fix xcode=7.3 in travis file.
sven1977 Jan 21, 2020
b3de297
Update osx_image to 9.4.
sven1977 Jan 21, 2020
7c84420
Test fix OSX build failure.
sven1977 Jan 21, 2020
d0b8a55
Fix travis: python language for mac not supported.
sven1977 Jan 21, 2020
6bcd400
dont suppress install-ray output
sven1977 Jan 21, 2020
6ea61d8
print out npm version.
sven1977 Jan 21, 2020
5b6c13c
Merge branch 'upstream_master' into remove_remaining_future_imports
sven1977 Jan 21, 2020
28f6056
Upgrade to latest npm version before using ci option, which is not su…
sven1977 Jan 21, 2020
faf0912
Move npm upgrade to before `nvm.sh` and `nvm use node` calls.
sven1977 Jan 21, 2020
f492451
Try to fix nvm vs npm version mismatch.
sven1977 Jan 21, 2020
4be3e3c
Printout npm nodejs versions.
sven1977 Jan 21, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 21 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,33 @@
language: generic
language: python
# Use Ubuntu 16.04
dist: xenial

python:
- "3.5"

matrix:
include:
- os: linux
env: PYTHON=3.5 PYTHONWARNINGS=ignore
env: PYTHONWARNINGS=ignore

- os: osx
osx_image: xcode7
osx_image: xcode7.3
language: generic
env: PYTHON=3.5 PYTHONWARNINGS=ignore

- os: linux
env:
- JDK='Oracle JDK 8'
- PYTHON=3.5 PYTHONWARNINGS=ignore
- PYTHONWARNINGS=ignore
- RAY_INSTALL_JAVA=1
install:
- eval `python $TRAVIS_BUILD_DIR/ci/travis/determine_tests_to_run.py`
- if [ $RAY_CI_JAVA_AFFECTED != "1" ]; then exit; fi
- ./ci/travis/install-bazel.sh
- ./ci/suppress_output ./ci/travis/install-dependencies.sh
- export PATH="$HOME/miniconda/bin:$PATH"
- ./ci/suppress_output ./ci/travis/install-ray.sh
#- ./ci/suppress_output ./ci/travis/install-ray.sh
- ./ci/travis/install-ray.sh
script:
- if [ $RAY_CI_JAVA_AFFECTED != "1" ]; then exit; fi
- ./java/test.sh
Expand All @@ -32,15 +37,16 @@ matrix:
- TESTSUITE=streaming
- JDK='Oracle JDK 8'
- RAY_INSTALL_JAVA=1
- PYTHON=3.5 PYTHONWARNINGS=ignore
- PYTHONWARNINGS=ignore
install:
- python $TRAVIS_BUILD_DIR/ci/travis/determine_tests_to_run.py
- eval `python $TRAVIS_BUILD_DIR/ci/travis/determine_tests_to_run.py`
- if [[ $RAY_CI_STREAMING_PYTHON_AFFECTED != "1" && $RAY_CI_STREAMING_JAVA_AFFECTED != "1" ]]; then exit; fi
- ./ci/travis/install-bazel.sh
- ./ci/suppress_output ./ci/travis/install-dependencies.sh
- export PATH="$HOME/miniconda/bin:$PATH"
- ./ci/suppress_output ./ci/travis/install-ray.sh
#- ./ci/suppress_output ./ci/travis/install-ray.sh
- ./ci/travis/install-ray.sh
script:
# Streaming cpp test.
- if [ $RAY_CI_STREAMING_CPP_AFFECTED == "1" ]; then ./ci/suppress_output bazel test //streaming:all && bash streaming/src/test/run_streaming_queue_test.sh; fi
Expand All @@ -53,6 +59,7 @@ matrix:
- sudo apt-get update -qq
install: []
script:
- python -V
- ./ci/travis/check-git-clang-format-output.sh
# Try generating Sphinx documentation. To do this, we need to install
# Ray first.
Expand Down Expand Up @@ -81,7 +88,7 @@ matrix:
- ./ci/travis/bazel-format.sh

- os: linux
env: SANITIZER=1 CC=clang PYTHON=3.5 PYTHONWARNINGS=ignore
env: SANITIZER=1 CC=clang PYTHONWARNINGS=ignore

install:
- eval `python $TRAVIS_BUILD_DIR/ci/travis/determine_tests_to_run.py`
Expand All @@ -90,8 +97,8 @@ matrix:
- ./ci/suppress_output ./ci/travis/install-bazel.sh
- ./ci/suppress_output ./ci/travis/install-dependencies.sh
- export PATH="$HOME/miniconda/bin:$PATH"
- ./ci/suppress_output ./ci/travis/install-ray.sh

#- ./ci/suppress_output ./ci/travis/install-ray.sh
- ./ci/travis/install-ray.sh
script:
# Run core worker tests with thread sanitizer
- RAY_BAZEL_CONFIG="--config=tsan" TSAN_OPTIONS="report_atomic_races=0" ./ci/suppress_output bash src/ray/test/run_core_worker_tests.sh
Expand Down Expand Up @@ -123,8 +130,8 @@ matrix:

# Build MacOS wheels.
- os: osx
osx_image: xcode7
env: MAC_WHEELS=1 PYTHONWARNINGS=ignore RAY_INSTALL_JAVA=1
osx_image: xcode7.3
env: PYTHON=3.5 MAC_WHEELS=1 PYTHONWARNINGS=ignore RAY_INSTALL_JAVA=1
install:
- eval `python $TRAVIS_BUILD_DIR/ci/travis/determine_tests_to_run.py`
- if [ $RAY_CI_MACOS_WHEELS_AFFECTED != "1" ]; then exit; fi
Expand All @@ -144,7 +151,8 @@ install:
- ./ci/travis/install-bazel.sh
- ./ci/suppress_output ./ci/travis/install-dependencies.sh
- export PATH="$HOME/miniconda/bin:$PATH"
- ./ci/suppress_output ./ci/travis/install-ray.sh
#- ./ci/suppress_output ./ci/travis/install-ray.sh
- ./ci/travis/install-ray.sh
- ./ci/suppress_output ./ci/travis/install-cython-examples.sh

- eval "$(curl -sL https://raw.githubusercontent.com/travis-ci/gimme/master/gimme | GIMME_GO_VERSION=master bash)"
Expand Down
4 changes: 0 additions & 4 deletions ci/travis/determine_tests_to_run.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
# Script used for checking changes for incremental testing cases
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import os
import subprocess
import sys
Expand Down
2 changes: 0 additions & 2 deletions ci/travis/git-clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ git clang-format -h

Requires Python 2.7 or Python 3
"""

from __future__ import absolute_import, division, print_function
import argparse
import collections
import contextlib
Expand Down
27 changes: 8 additions & 19 deletions ci/travis/install-cython-examples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,15 @@ set -e

ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE:-$0}")"; pwd)

echo "PYTHON is $PYTHON"
echo "PYTHON env var is set to $PYTHON, actual version is: "
# Print out actual version.
python -V

cython_examples="$ROOT_DIR/../../doc/examples/cython"

if [[ "$PYTHON" == "3.5" ]]; then
export PATH="$HOME/miniconda/bin:$PATH"
export PATH="$HOME/miniconda/bin:$PATH"

pushd $cython_examples
pip install --progress-bar=off scipy
python setup.py install --user
popd

elif [[ "$LINT" == "1" ]]; then
export PATH="$HOME/miniconda/bin:$PATH"

pushd $cython_examples
python setup.py install --user
popd

else
echo "Unrecognized Python version."
exit 1
fi
pushd $cython_examples
pip install --progress-bar=off scipy
python setup.py install --user
popd
38 changes: 20 additions & 18 deletions ci/travis/install-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE:-$0}")"; pwd)

echo "PYTHON is $PYTHON"
echo "PYTHON env var is set to $PYTHON, actual version is: "
# Print out actual version.
python -V

platform="unknown"
unamestr="$(uname)"
Expand All @@ -17,7 +19,21 @@ else
exit 1
fi

if [[ "$PYTHON" == "3.5" ]] && [[ "$platform" == "linux" ]]; then
if [[ "$LINT" == "1" ]]; then
sudo apt-get update
sudo apt-get install -y build-essential curl unzip
# Install miniconda.
wget -q https://repo.continuum.io/miniconda/Miniconda3-4.5.4-Linux-x86_64.sh -O miniconda.sh -nv
bash miniconda.sh -b -p $HOME/miniconda
export PATH="$HOME/miniconda/bin:$PATH"
# Install Python linting tools.
pip install -q flake8==3.7.7 flake8-comprehensions flake8-quotes==2.0.0
elif [[ "$LINUX_WHEELS" == "1" ]]; then
sudo apt-get install docker
sudo usermod -a -G docker travis
elif [[ "$MAC_WHEELS" == "1" ]]; then
:
elif [[ "$platform" == "linux" ]]; then
sudo apt-get update
sudo apt-get install -y python-dev python-numpy build-essential curl unzip tmux gdb
# Install miniconda.
Expand All @@ -28,7 +44,7 @@ if [[ "$PYTHON" == "3.5" ]] && [[ "$platform" == "linux" ]]; then
feather-format lxml openpyxl xlrd py-spy setproctitle pytest-timeout networkx tabulate psutil aiohttp \
uvicorn dataclasses pygments werkzeug kubernetes flask grpcio pytest-sugar pytest-rerunfailures pytest-asyncio \
blist
elif [[ "$PYTHON" == "3.5" ]] && [[ "$platform" == "macosx" ]]; then
elif [[ "$platform" == "macosx" ]]; then
# Install miniconda.
wget -q https://repo.continuum.io/miniconda/Miniconda3-4.5.4-MacOSX-x86_64.sh -O miniconda.sh -nv
bash miniconda.sh -b -p $HOME/miniconda
Expand All @@ -37,26 +53,12 @@ elif [[ "$PYTHON" == "3.5" ]] && [[ "$platform" == "macosx" ]]; then
feather-format lxml openpyxl xlrd py-spy setproctitle pytest-timeout networkx tabulate psutil aiohttp \
uvicorn dataclasses pygments werkzeug kubernetes flask grpcio pytest-sugar pytest-rerunfailures pytest-asyncio \
blist
elif [[ "$LINT" == "1" ]]; then
sudo apt-get update
sudo apt-get install -y build-essential curl unzip
# Install miniconda.
wget -q https://repo.continuum.io/miniconda/Miniconda3-4.5.4-Linux-x86_64.sh -O miniconda.sh -nv
bash miniconda.sh -b -p $HOME/miniconda
export PATH="$HOME/miniconda/bin:$PATH"
# Install Python linting tools.
pip install -q flake8==3.7.7 flake8-comprehensions flake8-quotes==2.0.0
elif [[ "$LINUX_WHEELS" == "1" ]]; then
sudo apt-get install docker
sudo usermod -a -G docker travis
elif [[ "$MAC_WHEELS" == "1" ]]; then
:
else
echo "Unrecognized environment."
exit 1
fi

if [[ "$PYTHON" == "3.5" ]] || [[ "$MAC_WHEELS" == "1" ]]; then
if [[ "$MAC_WHEELS" == "1" ]]; then
# Install the latest version of Node.js in order to build the dashboard.
source $HOME/.nvm/nvm.sh
nvm install node
Expand Down
41 changes: 19 additions & 22 deletions ci/travis/install-ray.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ set -e

ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE:-$0}")"; pwd)

echo "PYTHON is $PYTHON"
echo "PYTHON env var is set to $PYTHON, actual version is: "
# Print out actual version.
python -V

# If we are in Travis, most of the compilation result will be cached.
# This means we are I/O bounded. By default, Bazel set the number of concurrent
Expand All @@ -16,27 +18,22 @@ if [[ "$TRAVIS" == "true" ]]; then
echo "build --jobs=50" >> $HOME/.bazelrc
fi

if [[ "$PYTHON" == "3.5" ]]; then
export PATH="$HOME/miniconda/bin:$PATH"

pushd "$ROOT_DIR/../../python"
pushd ray/dashboard/client
source $HOME/.nvm/nvm.sh
nvm use node
npm ci
npm run build
popd
python setup.py install --user
popd
export PATH="$HOME/miniconda/bin:$PATH"

elif [[ "$LINT" == "1" ]]; then
export PATH="$HOME/miniconda/bin:$PATH"
npm install -g npm@latest

pushd "$ROOT_DIR/../../python"
python setup.py install --user
popd
else
echo "Unrecognized Python version."
exit 1
fi
echo "npm version = "
npm --version
echo "nodejs version = "
nodejs --version

pushd "$ROOT_DIR/../../python"
pushd ray/dashboard/client
source $HOME/.nvm/nvm.sh
#nvm install-latest-npm
nvm use node
npm ci
npm run build
popd
python setup.py install --user
popd
1 change: 0 additions & 1 deletion python/ray/cloudpickle/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import absolute_import
import os
import sys

Expand Down
2 changes: 0 additions & 2 deletions python/ray/cloudpickle/cloudpickle.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""
from __future__ import print_function

import dis
from functools import partial
import io
Expand Down
3 changes: 0 additions & 3 deletions python/ray/tests/test_cython.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from __future__ import absolute_import
from __future__ import print_function

import math
import numpy as np
import unittest
Expand Down
2 changes: 0 additions & 2 deletions python/ray/tune/examples/mnist_pytorch_trainable.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Original Code here:
# https://github.com/pytorch/examples/blob/master/mnist/main.py
from __future__ import print_function

import argparse
import os
import torch
Expand Down
3 changes: 0 additions & 3 deletions python/ray/tune/examples/pbt_memnn_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

References Keras and is based off of https://keras.io/examples/babi_memnn/.
"""

from __future__ import print_function

from tensorflow.keras.models import Sequential, Model, load_model
from tensorflow.keras.layers import Embedding
from tensorflow.keras.layers import (Input, Activation, Dense, Permute,
Expand Down
3 changes: 0 additions & 3 deletions python/ray/tune/examples/pbt_tune_cifar10_with_keras.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
can set {"gpu": 0} to use CPUs for training, although
it is less efficient.
"""

from __future__ import print_function

import argparse

import numpy as np
Expand Down
2 changes: 0 additions & 2 deletions python/ray/tune/examples/tune_cifar10_gluon.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import print_function

import argparse
import random

Expand Down
2 changes: 0 additions & 2 deletions python/ray/tune/progress_reporter.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import print_function

import collections

from ray.tune.result import (DEFAULT_RESULT_KEYS, CONFIG_PREFIX,
Expand Down