Skip to content

Commit

Permalink
Merge pull request tensorflow#193 from yongtang/python3.7
Browse files Browse the repository at this point in the history
Enable Python 3.7 build
  • Loading branch information
terrytangyuan committed Apr 17, 2019
2 parents b52438a + 6cd8910 commit cde3bd2
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 2 deletions.
22 changes: 22 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ jobs:
before_script: *developer_build
script:
- docker run -i -t --rm -v $PWD:/v -v $PWD/.cache/pip/:/root/.cache/pip -w /v --net=host buildpack-deps:18.04 bash -x -e script.sh

# Preview Release Builds are for TensorFlow 2.0 Preview release.
# Note only Linux (Ubuntu 18.04) and macOS are supported.
- stage: release
Expand All @@ -74,6 +75,16 @@ jobs:
if [[ ( ${TRAVIS_BRANCH} == "master" ) && ( ${TRAVIS_EVENT_TYPE} != "pull_request" ) ]]; then
twine upload wheelhouse/*.whl
fi
- stage: release
name: "TensorFlow 2.0 Preview Release Build on Linux with Python 3.7"
script:
- docker run -i -t --rm -v $PWD:/v -v $PWD/.cache/pip/:/root/.cache/pip -w /v --net=host ubuntu:16.04 bash -x -e .travis/python3.7+.release.sh python3.7 tensorflow==2.0.0alpha --preview ${TRAVIS_BUILD_NUMBER}
- echo "Skip test for now, will fix later"
after_success:
- |
if [[ ( ${TRAVIS_BRANCH} == "master" ) && ( ${TRAVIS_EVENT_TYPE} != "pull_request" ) ]]; then
twine upload wheelhouse/*.whl
fi
- stage: release
name: "TensorFlow 2.0 Preview Release Build on macOS"
os: osx
Expand All @@ -86,6 +97,7 @@ jobs:
if [[ ( ${TRAVIS_BRANCH} == "master" ) && ( ${TRAVIS_EVENT_TYPE} != "pull_request" ) ]]; then
twine upload wheelhouse/*.whl
fi
# Release Builds are for nightly release.
# Note Python 2.7, 3.4, 3.5, 3.6 are supported on Linux
# for Ubuntu 14.04/16.04/18.04, and Python 2.7 for macOS.
Expand All @@ -99,6 +111,16 @@ jobs:
if [[ ( ${TRAVIS_BRANCH} == "master" ) && ( ${TRAVIS_EVENT_TYPE} != "pull_request" ) ]]; then
twine upload wheelhouse/*.whl
fi
- stage: release
name: "Nightly Release Build on Linux with Python 3.7"
script:
- docker run -i -t --rm -v $PWD:/v -v $PWD/.cache/pip/:/root/.cache/pip -w /v --net=host ubuntu:16.04 bash -x -e .travis/python3.7+.release.sh python3.7 "${TENSORFLOW_INSTALL}" --nightly ${TRAVIS_BUILD_NUMBER}
- echo "Skip test for now, will fix later"
after_success:
- |
if [[ ( ${TRAVIS_BRANCH} == "master" ) && ( ${TRAVIS_EVENT_TYPE} != "pull_request" ) ]]; then
twine upload wheelhouse/*.whl
fi
- stage: release
name: "Nightly Release Build on macOS"
os: osx
Expand Down
80 changes: 80 additions & 0 deletions .travis/python3.7+.release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
#!/usr/bin/env bash
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
set -e -x

# Release:
# docker run -i -t --rm -v $PWD:/v -w /v --net=host ubuntu:16.04 /v/.travis/python3.7+.release.sh


apt-get -y -qq update && apt-get -y -qq install \
software-properties-common \
gcc g++ make patch \
unzip curl patchelf

add-apt-repository -y ppa:deadsnakes/ppa

apt-get -y -qq update

curl -sSOL https://bootstrap.pypa.io/get-pip.py

export PYTHON_VERSION="python3.7"
if [[ "$#" -gt 0 ]]; then
export PYTHON_VERSION="${1}"
shift
fi

apt-get -y -qq update && apt-get -y -qq install $PYTHON_VERSION
$PYTHON_VERSION get-pip.py -q
$PYTHON_VERSION -m pip --version

export TENSORFLOW_INSTALL="$(${PYTHON_VERSION} setup.py --package-version)"
if [[ "$#" -gt 0 ]]; then
export TENSORFLOW_INSTALL="${1}"
shift
fi
export BAZEL_VERSION=0.24.1 BAZEL_OS=$(uname | tr '[:upper:]' '[:lower:]')



curl -sSOL https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-installer-${BAZEL_OS}-x86_64.sh
bash -e bazel-${BAZEL_VERSION}-installer-${BAZEL_OS}-x86_64.sh 2>&1 > bazel-install.log || (cat bazel-install.log && false)
bazel version

$PYTHON_VERSION -m pip install -q "${TENSORFLOW_INSTALL}"
$PYTHON_VERSION -c 'import tensorflow as tf; print(tf.version.VERSION)'
$PYTHON_VERSION config_helper.py

bash -x -e .travis/bazel.build.sh


if [[ "$1" == "--"* ]]; then
VERSION_CHOICE=$1
VERSION_NUMBER=$2
shift
shift
fi

$PYTHON_VERSION setup.py --data bazel-bin -q bdist_wheel $VERSION_CHOICE $VERSION_NUMBER
ls dist/*

$PYTHON_VERSION -m pip install -q wheel==0.31.1
$PYTHON_VERSION -m pip install -q auditwheel==1.5.0
auditwheel --version
for f in dist/*.whl; do
auditwheel repair $f
done
ls wheelhouse/*

1 change: 0 additions & 1 deletion tensorflow_io/cifar/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ cc_binary(
copts = [
"-pthread",
"-std=c++11",
"-D_GLIBCXX_USE_CXX11_ABI=0",
"-DNDEBUG",
],
linkshared = 1,
Expand Down
1 change: 0 additions & 1 deletion third_party/libarchive.BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ cc_library(
"libarchive/archive_entry.h",
],
copts = [
"-D_GLIBCXX_USE_CXX11_ABI=0",
"-DPLATFORM_CONFIG_H=<config.h>",
] + select({
"@bazel_tools//src/conditions:darwin": [
Expand Down

0 comments on commit cde3bd2

Please sign in to comment.