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 .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ install:
- pip install flake8==3.5.0
- pip install futures==3.1.1
- pip install grpcio==1.6.3
- pip install mock==2.0.0
- pip install moto==1.3.7
- pip install yamllint==1.5.0
- |
Expand Down
2 changes: 2 additions & 0 deletions tensorboard/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ py_test(
":test",
":version",
"//tensorboard/util:tb_logging",
"@org_pythonhosted_mock",
"@org_pythonhosted_six",
],
)
Expand All @@ -101,6 +102,7 @@ py_test(
deps = [
":manager",
"//tensorboard:expect_tensorflow_installed",
"@org_pythonhosted_mock",
"@org_pythonhosted_six",
],
data = [
Expand Down
1 change: 1 addition & 0 deletions tensorboard/backend/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ py_test(
"//tensorboard/backend/event_processing:event_multiplexer",
"//tensorboard/plugins:base_plugin",
"@org_pocoo_werkzeug",
"@org_pythonhosted_mock",
],
)

Expand Down
3 changes: 3 additions & 0 deletions tensorboard/plugins/hparams/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ py_test(
"//tensorboard:expect_tensorflow_installed",
"//tensorboard/backend/event_processing:event_accumulator",
"//tensorboard/backend/event_processing:event_multiplexer",
"@org_pythonhosted_mock",
],
)

Expand All @@ -73,6 +74,7 @@ py_test(
deps = [
":hparams_plugin",
"//tensorboard:expect_tensorflow_installed",
"@org_pythonhosted_mock",
],
)

Expand All @@ -87,6 +89,7 @@ py_test(
"//tensorboard:expect_tensorflow_installed",
"//tensorboard/backend/event_processing:event_accumulator",
"//tensorboard/backend/event_processing:event_multiplexer",
"@org_pythonhosted_mock",
],
)

Expand Down
1 change: 1 addition & 0 deletions tensorboard/plugins/interactive_inference/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ py_test(
"//tensorboard/plugins/interactive_inference/utils:platform_utils",
"//tensorboard/plugins/interactive_inference/utils:test_utils",
"@org_pocoo_werkzeug",
"@org_pythonhosted_mock",
"@org_pythonhosted_six",
],
)
1 change: 1 addition & 0 deletions tensorboard/plugins/interactive_inference/utils/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ py_test(
":test_utils",
"//tensorboard:expect_numpy_installed",
"//tensorboard:expect_tensorflow_installed",
"@org_pythonhosted_mock",
"@org_tensorflow_serving_api",
],
)
15 changes: 15 additions & 0 deletions third_party/mock.BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Description:
# Rolling backport of unittest.mock for all Pythons

licenses(["notice"]) # MIT

exports_files(["LICENSE"])

py_library(
name = "org_pythonhosted_mock",
srcs = [
"mock.py",
],
srcs_version = "PY2AND3",
visibility = ["//visibility:public"],
)
17 changes: 17 additions & 0 deletions third_party/python.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,23 @@ def tensorboard_python_workspace():
build_file = str(Label("//third_party:werkzeug.BUILD")),
)

# We use `mock==1.0.0` because later versions depend on `pbr`, which
# doesn't work well in a hermetic context (it tries to look up some
# global configuration files; see GitHub pull request #2132).
#
# This dependency can go away entirely once we drop Python 2 support
# and can just depend on `unittest.mock`.
http_archive(
name = "org_pythonhosted_mock",
urls = [
"https://mirror.bazel.build/files.pythonhosted.org/packages/85/60/ec8c1af81337bab0caba188b218b6758bc94f125f49062f7c5f0647749d2/mock-1.0.0.tar.gz",
"https://files.pythonhosted.org/packages/85/60/ec8c1af81337bab0caba188b218b6758bc94f125f49062f7c5f0647749d2/mock-1.0.0.tar.gz",
],
sha256 = "2d9fbe67001d2e8f02692075257f3c11e1b0194bd838c8ce3f49b31fc6c3f033",
strip_prefix = "mock-1.0.0",
build_file = str(Label("//third_party:mock.BUILD")),
)

http_archive(
name = "org_pythonhosted_six",
urls = [
Expand Down