Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion docs/image_summaries.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@
"import io\n",
"import itertools\n",
"from packaging import version\n",
"from six.moves import range\n",
"\n",
"import tensorflow as tf\n",
"from tensorflow import keras\n",
Expand Down
22 changes: 2 additions & 20 deletions tensorboard/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,13 @@ py_test(
srcs_version = "PY3",
tags = ["support_notf"],
visibility = ["//tensorboard:internal"],
deps = [
":lib",
"@org_pythonhosted_six",
],
deps = [":lib"],
)

py_library(
name = "auth",
srcs = ["auth.py"],
srcs_version = "PY3",
deps = [
"@org_pythonhosted_six",
],
)

py_test(
Expand Down Expand Up @@ -148,7 +142,6 @@ py_library(
deps = [
":version",
"//tensorboard/util:tb_logging",
"@org_pythonhosted_six",
],
)

Expand All @@ -164,7 +157,6 @@ py_test(
":test",
":version",
"//tensorboard/util:tb_logging",
"@org_pythonhosted_six",
],
)

Expand All @@ -185,7 +177,6 @@ py_test(
deps = [
":manager",
"//tensorboard:expect_tensorflow_installed",
"@org_pythonhosted_six",
],
)

Expand Down Expand Up @@ -213,7 +204,6 @@ py_library(
"//tensorboard/backend/event_processing:event_file_inspector",
"//tensorboard/data:server_ingester",
"@org_pocoo_werkzeug",
"@org_pythonhosted_six",
],
)

Expand All @@ -230,7 +220,6 @@ py_test(
"//tensorboard/plugins:base_plugin",
"//tensorboard/plugins/core:core_plugin",
"@org_pocoo_werkzeug",
"@org_pythonhosted_six",
],
)

Expand All @@ -242,7 +231,6 @@ py_library(
deps = [
"//tensorboard:expect_absl_testing_absltest_installed",
"//tensorboard/util:tb_logging",
"@org_pythonhosted_six",
],
)

Expand Down Expand Up @@ -523,7 +511,6 @@ py_binary(
"//tensorboard:expect_tensorflow_installed",
"//tensorboard/util:encoder",
"//tensorboard/util:tb_logging",
"@org_pythonhosted_six",
],
)

Expand All @@ -537,7 +524,6 @@ py_library(
"//tensorboard/backend:experiment_id",
"@org_mozilla_bleach",
"@org_pythonhosted_markdown",
"@org_pythonhosted_six",
],
)

Expand All @@ -552,7 +538,6 @@ py_test(
":plugin_util",
":test",
"//tensorboard/backend:experiment_id",
"@org_pythonhosted_six",
],
)

Expand All @@ -574,8 +559,5 @@ py_test(
srcs = ["lazy_test.py"],
srcs_version = "PY3",
tags = ["support_notf"],
deps = [
":lazy",
"@org_pythonhosted_six",
],
deps = [":lazy"],
)
5 changes: 1 addition & 4 deletions tensorboard/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,8 @@

import abc

import six


@six.add_metaclass(abc.ABCMeta)
class AuthProvider(object):
class AuthProvider(metaclass=abc.ABCMeta):
"""Authentication provider for a specific kind of credential."""

def authenticate(self, environ):
Expand Down
3 changes: 0 additions & 3 deletions tensorboard/backend/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ py_library(
deps = [
":json_util",
"@org_pocoo_werkzeug",
"@org_pythonhosted_six",
],
)

Expand All @@ -27,7 +26,6 @@ py_test(
":http_util",
"//tensorboard:test",
"@org_pocoo_werkzeug",
"@org_pythonhosted_six",
],
)

Expand Down Expand Up @@ -68,7 +66,6 @@ py_library(
"//tensorboard/plugins/core:core_plugin",
"//tensorboard/util:tb_logging",
"@org_pocoo_werkzeug",
"@org_pythonhosted_six",
],
)

Expand Down
8 changes: 2 additions & 6 deletions tensorboard/backend/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,9 @@
import re
import textwrap
import time
from urllib import parse as urlparse
import zipfile

import six
from six.moves.urllib import (
parse as urlparse,
) # pylint: disable=wrong-import-order

from werkzeug import wrappers

from tensorboard import errors
Expand Down Expand Up @@ -316,7 +312,7 @@ def __init__(
# over a more general one (e.g., a catchall route `/*` should come last).
self.prefix_routes = collections.OrderedDict(
sorted(
six.iteritems(unordered_prefix_routes),
unordered_prefix_routes.items(),
key=lambda x: len(x[0]),
reverse=True,
)
Expand Down
37 changes: 18 additions & 19 deletions tensorboard/backend/application_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import json
from unittest import mock

import six
from werkzeug import test as werkzeug_test
from werkzeug import wrappers

Expand Down Expand Up @@ -446,8 +445,8 @@ def testPluginEntryBadModulePath(self):
]
app = application.TensorBoardWSGI(plugins)
server = werkzeug_test.Client(app, wrappers.BaseResponse)
with six.assertRaisesRegex(
self, ValueError, "Expected es_module_path to be non-absolute path"
with self.assertRaisesRegex(
ValueError, "Expected es_module_path to be non-absolute path"
):
server.get("/data/plugin_entry.html?name=mallory")

Expand All @@ -461,8 +460,8 @@ def testNgComponentPluginWithIncompatibleSetElementName(self):
]
app = application.TensorBoardWSGI(plugins)
server = werkzeug_test.Client(app, wrappers.BaseResponse)
with six.assertRaisesRegex(
self, ValueError, "quux.*declared.*both Angular.*legacy"
with self.assertRaisesRegex(
ValueError, "quux.*declared.*both Angular.*legacy"
):
server.get("/data/plugins_listing")

Expand All @@ -476,8 +475,8 @@ def testNgComponentPluginWithIncompatiblEsModulePath(self):
]
app = application.TensorBoardWSGI(plugins)
server = werkzeug_test.Client(app, wrappers.BaseResponse)
with six.assertRaisesRegex(
self, ValueError, "quux.*declared.*both Angular.*iframed"
with self.assertRaisesRegex(
ValueError, "quux.*declared.*both Angular.*iframed"
):
server.get("/data/plugins_listing")

Expand Down Expand Up @@ -576,33 +575,33 @@ def testComprehensiveName(self):
)

def testNameIsNone(self):
with six.assertRaisesRegex(self, ValueError, r"no plugin_name"):
with self.assertRaisesRegex(ValueError, r"no plugin_name"):
application.TensorBoardWSGI(plugins=[FakePlugin(plugin_name=None)])

def testEmptyName(self):
with six.assertRaisesRegex(self, ValueError, r"invalid name"):
with self.assertRaisesRegex(ValueError, r"invalid name"):
application.TensorBoardWSGI(plugins=[FakePlugin(plugin_name="")])

def testNameWithSlashes(self):
with six.assertRaisesRegex(self, ValueError, r"invalid name"):
with self.assertRaisesRegex(ValueError, r"invalid name"):
application.TensorBoardWSGI(
plugins=[FakePlugin(plugin_name="scalars/data")]
)

def testNameWithPeriods(self):
with six.assertRaisesRegex(self, ValueError, r"invalid name"):
with self.assertRaisesRegex(ValueError, r"invalid name"):
application.TensorBoardWSGI(
plugins=[FakePlugin(plugin_name="scalars.data")]
)

def testNameWithSpaces(self):
with six.assertRaisesRegex(self, ValueError, r"invalid name"):
with self.assertRaisesRegex(ValueError, r"invalid name"):
application.TensorBoardWSGI(
plugins=[FakePlugin(plugin_name="my favorite plugin")]
)

def testDuplicateName(self):
with six.assertRaisesRegex(self, ValueError, r"Duplicate"):
with self.assertRaisesRegex(ValueError, r"Duplicate"):
application.TensorBoardWSGI(
plugins=[
FakePlugin(plugin_name="scalars"),
Expand All @@ -625,23 +624,23 @@ def testWildcardRoute(self):
application.TensorBoardWSGI([self._make_plugin("/foo/*")])

def testNonPathComponentWildcardRoute(self):
with six.assertRaisesRegex(self, ValueError, r"invalid route"):
with self.assertRaisesRegex(ValueError, r"invalid route"):
application.TensorBoardWSGI([self._make_plugin("/foo*")])

def testMultiWildcardRoute(self):
with six.assertRaisesRegex(self, ValueError, r"invalid route"):
with self.assertRaisesRegex(ValueError, r"invalid route"):
application.TensorBoardWSGI([self._make_plugin("/foo/*/bar/*")])

def testInternalWildcardRoute(self):
with six.assertRaisesRegex(self, ValueError, r"invalid route"):
with self.assertRaisesRegex(ValueError, r"invalid route"):
application.TensorBoardWSGI([self._make_plugin("/foo/*/bar")])

def testEmptyRoute(self):
with six.assertRaisesRegex(self, ValueError, r"invalid route"):
with self.assertRaisesRegex(ValueError, r"invalid route"):
application.TensorBoardWSGI([self._make_plugin("")])

def testSlashlessRoute(self):
with six.assertRaisesRegex(self, ValueError, r"invalid route"):
with self.assertRaisesRegex(ValueError, r"invalid route"):
application.TensorBoardWSGI([self._make_plugin("runaway")])


Expand All @@ -660,7 +659,7 @@ def testMakePluginLoader_pluginLoader(self):
self.assertIs(loader, application.make_plugin_loader(loader))

def testMakePluginLoader_invalidType(self):
with six.assertRaisesRegex(self, TypeError, "FakePlugin"):
with self.assertRaisesRegex(TypeError, "FakePlugin"):
application.make_plugin_loader(FakePlugin())


Expand Down
8 changes: 0 additions & 8 deletions tensorboard/backend/event_processing/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ py_library(
deps = [
"//tensorboard/compat:tensorflow",
"//tensorboard/util:tb_logging",
"@org_pythonhosted_six",
],
)

Expand All @@ -25,7 +24,6 @@ py_test(
deps = [
":io_wrapper",
"//tensorboard:expect_tensorflow_installed",
"@org_pythonhosted_six",
],
)

Expand Down Expand Up @@ -68,7 +66,6 @@ py_library(
"//tensorboard/data:provider",
"//tensorboard/util:tb_logging",
"//tensorboard/util:tensor_util",
"@org_pythonhosted_six",
],
)

Expand All @@ -91,7 +88,6 @@ py_test(
"//tensorboard/plugins/scalar:metadata",
"//tensorboard/plugins/scalar:summary_v2",
"//tensorboard/util:tensor_util",
"@org_pythonhosted_six",
],
)

Expand Down Expand Up @@ -186,7 +182,6 @@ py_test(
"//tensorboard:expect_tensorflow_installed",
"//tensorboard/compat/proto:protos_all_py_pb2",
"//tensorboard/summary/writer",
"@org_pythonhosted_six",
],
)

Expand All @@ -202,7 +197,6 @@ py_test(
"//tensorboard/compat:no_tensorflow",
"//tensorboard/compat/proto:protos_all_py_pb2",
"//tensorboard/summary/writer",
"@org_pythonhosted_six",
],
)

Expand Down Expand Up @@ -274,7 +268,6 @@ py_test(
"//tensorboard/util:tb_logging",
"//tensorboard/util:tensor_util",
"//tensorboard/util:test_util",
"@org_pythonhosted_six",
],
)

Expand All @@ -291,7 +284,6 @@ py_library(
":event_accumulator",
":io_wrapper",
"//tensorboard/util:tb_logging",
"@org_pythonhosted_six",
],
)

Expand Down
3 changes: 1 addition & 2 deletions tensorboard/backend/event_processing/data_ingester.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import threading
import time

import six

from tensorboard.backend.event_processing import data_provider
from tensorboard.backend.event_processing import plugin_event_multiplexer
Expand Down Expand Up @@ -97,7 +96,7 @@ def _reload():
while True:
start = time.time()
logger.info("TensorBoard reload process beginning")
for path, name in six.iteritems(self._path_to_run):
for path, name in self._path_to_run.items():
self._multiplexer.AddRunsFromDirectory(path, name)
logger.info(
"TensorBoard reload process: Reload the whole Multiplexer"
Expand Down
Loading