Skip to content

Commit

Permalink
shell_utils.py: Upgrade from Python 2.7 to 3.5
Browse files Browse the repository at this point in the history
Signed-off-by: cclauss <cclauss@me.com>
  • Loading branch information
cclauss committed Jun 26, 2019
2 parents 5093561 + c37b3ab commit 92f85b3
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .azure-pipelines/linux.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
resources:
containers:
- container: envoy-build
image: envoyproxy/envoy-build:ec38ecb88fd1abe55ab1daa2f6bd239ffccc9d98
image: envoyproxy/envoy-build:d0cefa7f071dbd4ef24399c2db8656c3a5d8c3ef

jobs:
- job: EnvoyFullTest
Expand Down
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ executors:
ubuntu-build:
description: "A regular build executor based on ubuntu image"
docker:
- image: envoyproxy/envoy-build:ec38ecb88fd1abe55ab1daa2f6bd239ffccc9d98
- image: envoyproxy/envoy-build:d0cefa7f071dbd4ef24399c2db8656c3a5d8c3ef
resource_class: xlarge
working_directory: /source

Expand Down
2 changes: 2 additions & 0 deletions api/tools/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ py_binary(
name = "tap2pcap",
srcs = ["tap2pcap.py"],
licenses = ["notice"], # Apache 2
python_version = "PY2",
visibility = ["//visibility:public"],
deps = [
"//envoy/data/tap/v2alpha:wrapper_py",
Expand All @@ -17,6 +18,7 @@ py_test(
"data/tap2pcap_h2_ipv4.pb_text",
"data/tap2pcap_h2_ipv4.txt",
],
python_version = "PY2",
# Don't run this by default, since we don't want to force local dependency on Wireshark/tshark,
# will explicitly invoke in CI.
tags = ["manual"],
Expand Down
1 change: 1 addition & 0 deletions bazel/external/gcovr.BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ par_binary(
name = "gcovr",
srcs = [":renamed_gcovr.py"],
main = ":renamed_gcovr.py",
python_version = "PY2",
visibility = ["//visibility:public"],
)

Expand Down
3 changes: 1 addition & 2 deletions bazel/gen_compilation_database.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/bash

#TODO(lizan): revert to released version once new version is released
RELEASE_VERSION=d5a0ee259aa356886618eafae17ca05ebf79d6c2
RELEASE_VERSION=0.3.5

if [[ ! -d bazel-compilation-database-${RELEASE_VERSION} ]]; then
curl -L https://github.com/grailbio/bazel-compilation-database/archive/${RELEASE_VERSION}.tar.gz | tar -xz
Expand Down
6 changes: 3 additions & 3 deletions bazel/repository_locations.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ REPOSITORY_LOCATIONS = dict(
urls = ["https://github.com/gabime/spdlog/archive/v1.3.1.tar.gz"],
),
com_github_gcovr_gcovr = dict(
sha256 = "8a60ba6242d67a58320e9e16630d80448ef6d5284fda5fb3eff927b63c8b04a2",
strip_prefix = "gcovr-3.3",
urls = ["https://github.com/gcovr/gcovr/archive/3.3.tar.gz"],
sha256 = "1c52a71f245adfe1b45e30fbe5015337fe66546f17f40038b3969b7b42acceed",
strip_prefix = "gcovr-3.4",
urls = ["https://github.com/gcovr/gcovr/archive/3.4.tar.gz"],
),
com_github_google_libprotobuf_mutator = dict(
sha256 = "97b3639630040f41c45f45838ab00b78909e6b4cb69c8028e01302bea5b79495",
Expand Down
2 changes: 1 addition & 1 deletion ci/do_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ elif [[ "$CI_TARGET" == "bazel.coverage" ]]; then

# gcovr is a pain to run with `bazel run`, so package it up into a
# relocatable and hermetic-ish .par file.
bazel build @com_github_gcovr_gcovr//:gcovr.par
bazel build --python_version=PY2 @com_github_gcovr_gcovr//:gcovr.par
export GCOVR="/tmp/gcovr.par"
cp -f "${ENVOY_SRCDIR}/bazel-bin/external/com_github_gcovr_gcovr/gcovr.par" ${GCOVR}

Expand Down
1 change: 1 addition & 0 deletions tools/protodoc/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ licenses(["notice"]) # Apache 2
py_binary(
name = "protodoc",
srcs = ["protodoc.py"],
python_version = "PY2",
visibility = ["//visibility:public"],
deps = [
"@com_envoyproxy_protoc_gen_validate//validate:validate_py",
Expand Down
2 changes: 1 addition & 1 deletion tools/shell_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ source_venv() {
VENV_DIR=$1
if [[ "$VIRTUAL_ENV" == "" ]]; then
if [[ ! -d "${VENV_DIR}"/venv ]]; then
virtualenv "${VENV_DIR}"/venv --no-site-packages --python=python2.7
virtualenv "${VENV_DIR}"/venv --no-site-packages --python=python3.5
fi
source "${VENV_DIR}"/venv/bin/activate
else
Expand Down
8 changes: 4 additions & 4 deletions tools/socket_passing.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2.7
#!/usr/bin/env python3

# This tool is a helper script that queries the admin address for all listener
# addresses after envoy startup. (The admin address is written out to a file by
Expand All @@ -10,7 +10,7 @@
from collections import OrderedDict

import argparse
import httplib
import http.client
import json
import os.path
import re
Expand All @@ -29,12 +29,12 @@ def GenerateNewConfig(original_yaml, admin_address, updated_json):
with open(original_yaml, 'r') as original_file:
sys.stdout.write('Admin address is ' + admin_address + '\n')
try:
admin_conn = httplib.HTTPConnection(admin_address)
admin_conn = http.client.HTTPConnection(admin_address)
admin_conn.request('GET', '/listeners?format=json')
admin_response = admin_conn.getresponse()
if not admin_response.status == 200:
return False
discovered_listeners = json.loads(admin_response.read())
discovered_listeners = json.loads(admin_response.read().decode('utf-8'))
except Exception as e:
sys.stderr.write('Cannot connect to admin: %s\n' % e)
return False
Expand Down

0 comments on commit 92f85b3

Please sign in to comment.