diff --git a/tensorboard/pip_package/BUILD b/tensorboard/pip_package/BUILD index 9e71cad7eff..bfa29d9a672 100644 --- a/tensorboard/pip_package/BUILD +++ b/tensorboard/pip_package/BUILD @@ -86,7 +86,6 @@ genrule( "@npm//:node_modules/d3/LICENSE", "@com_google_fonts_roboto//:LICENSE", "@org_mozilla_bleach//:LICENSE", - "@org_html5lib//:LICENSE", "@org_pythonhosted_webencodings//:LICENSE", "//third_party:bh_tsne.LICENSE", ], diff --git a/tensorboard/pip_package/build_pip_package.sh b/tensorboard/pip_package/build_pip_package.sh index ef8df0104dc..9c5cd945c81 100755 --- a/tensorboard/pip_package/build_pip_package.sh +++ b/tensorboard/pip_package/build_pip_package.sh @@ -86,15 +86,12 @@ build() ( mkdir -p tensorboard/_vendor >tensorboard/_vendor/__init__.py - cp -LR "${RUNFILES}/org_html5lib/html5lib" tensorboard/_vendor cp -LR "${RUNFILES}/org_mozilla_bleach/bleach" tensorboard/_vendor cp -LR "${RUNFILES}/org_pythonhosted_webencodings/webencodings" tensorboard/_vendor chmod -R u+w,go+r . find tensorboard -name \*.py -exec $sedi -e ' - s/^import html5lib$/from tensorboard._vendor import html5lib/ - s/^from html5lib/from tensorboard._vendor.html5lib/ s/^import bleach$/from tensorboard._vendor import bleach/ s/^from bleach/from tensorboard._vendor.bleach/ s/^import webencodings$/from tensorboard._vendor import webencodings/ diff --git a/tensorboard/pip_package/requirements.txt b/tensorboard/pip_package/requirements.txt index 0cc39ff1ff6..27044df16d4 100644 --- a/tensorboard/pip_package/requirements.txt +++ b/tensorboard/pip_package/requirements.txt @@ -33,9 +33,5 @@ packaging # https://github.com/protocolbuffers/protobuf/issues/13485 protobuf >= 3.19.6, != 4.24.0 setuptools >= 41.0.0 # Note: provides pkg_resources as well as setuptools -# A dependency of our vendored packages. This lower bound has not been correctly -# vetted, but I wanted to be the least restrictive we can, since it's not a new -# requirement, and likely this will not disrupt existing users of the package. -six > 1.9 tensorboard-data-server >= 0.7.0, < 0.8.0 werkzeug >= 1.0.1 diff --git a/tensorboard/plugins/text/BUILD b/tensorboard/plugins/text/BUILD index 8476737993b..b7aa4bedc8f 100644 --- a/tensorboard/plugins/text/BUILD +++ b/tensorboard/plugins/text/BUILD @@ -21,7 +21,6 @@ py_library( "//tensorboard/backend:http_util", "//tensorboard/data:provider", "//tensorboard/plugins:base_plugin", - "@org_mozilla_bleach", "@org_pocoo_werkzeug", "@org_pythonhosted_markdown", ], diff --git a/third_party/bleach.BUILD b/third_party/bleach.BUILD index ca5320933d8..8415bb104b4 100644 --- a/third_party/bleach.BUILD +++ b/third_party/bleach.BUILD @@ -15,15 +15,11 @@ py_library( srcs = [ "bleach/__init__.py", "bleach/callbacks.py", - "bleach/encoding.py", + "bleach/html5lib_shim.py", "bleach/linkifier.py", + "bleach/parse_shim.py", "bleach/sanitizer.py", - "bleach/utils.py", - "bleach/version.py", - ], - srcs_version = "PY3", - deps = [ - "@org_html5lib", - "@org_pythonhosted_six", - ], + "bleach/six_shim.py", + ] + glob(["bleach/_vendor/**/*.py"]), + deps = ["@org_pythonhosted_webencodings"], ) diff --git a/third_party/html5lib.BUILD b/third_party/html5lib.BUILD deleted file mode 100644 index 24b448b00f0..00000000000 --- a/third_party/html5lib.BUILD +++ /dev/null @@ -1,54 +0,0 @@ -# Description: -# Import of html5lib library. - -load("@rules_python//python:py_library.bzl", "py_library") - -package(default_visibility = ["//visibility:public"]) - -licenses(["notice"]) # BSD-like notice-style license, see LICENSE file - -exports_files(["LICENSE"]) - -py_library( - name = "org_html5lib", - srcs = [ - "html5lib/__init__.py", - "html5lib/_ihatexml.py", - "html5lib/_inputstream.py", - "html5lib/_tokenizer.py", - "html5lib/_trie/__init__.py", - "html5lib/_trie/_base.py", - "html5lib/_trie/py.py", - "html5lib/_utils.py", - "html5lib/constants.py", - "html5lib/filters/__init__.py", - "html5lib/filters/alphabeticalattributes.py", - "html5lib/filters/base.py", - "html5lib/filters/inject_meta_charset.py", - "html5lib/filters/lint.py", - "html5lib/filters/optionaltags.py", - "html5lib/filters/sanitizer.py", - "html5lib/filters/whitespace.py", - "html5lib/html5parser.py", - "html5lib/serializer.py", - "html5lib/treeadapters/__init__.py", - "html5lib/treeadapters/genshi.py", - "html5lib/treeadapters/sax.py", - "html5lib/treebuilders/__init__.py", - "html5lib/treebuilders/base.py", - "html5lib/treebuilders/dom.py", - "html5lib/treebuilders/etree.py", - "html5lib/treebuilders/etree_lxml.py", - "html5lib/treewalkers/__init__.py", - "html5lib/treewalkers/base.py", - "html5lib/treewalkers/dom.py", - "html5lib/treewalkers/etree.py", - "html5lib/treewalkers/etree_lxml.py", - "html5lib/treewalkers/genshi.py", - ], - srcs_version = "PY3", - deps = [ - "@org_pythonhosted_six", - "@org_pythonhosted_webencodings", - ], -) diff --git a/third_party/python.bzl b/third_party/python.bzl index 8ac4a68c1c4..a5a78698f57 100644 --- a/third_party/python.bzl +++ b/third_party/python.bzl @@ -44,25 +44,14 @@ def tensorboard_python_workspace(): build_file = str(Label("//third_party:urllib3.BUILD")), ) - http_archive( - name = "org_html5lib", - urls = [ - "http://mirror.tensorflow.org/github.com/html5lib/html5lib-python/archive/1.1.tar.gz", - "https://github.com/html5lib/html5lib-python/archive/1.1.tar.gz", - ], - sha256 = "66e9e24a53c10c27abb6be8a3cf2cf55824c6ea1cef8570a633cb223ec46e894", - strip_prefix = "html5lib-python-1.1", - build_file = str(Label("//third_party:html5lib.BUILD")), - ) - http_archive( name = "org_mozilla_bleach", urls = [ - "http://mirror.tensorflow.org/github.com/mozilla/bleach/archive/v2.0.tar.gz", - "https://github.com/mozilla/bleach/archive/v2.0.tar.gz", + "http://mirror.tensorflow.org/files.pythonhosted.org/packages/76/9a/0e33f5054c54d349ea62c277191c020c2d6ef1d65ab2cb1993f91ec846d1/bleach-6.2.0.tar.gz", + "https://files.pythonhosted.org/packages/76/9a/0e33f5054c54d349ea62c277191c020c2d6ef1d65ab2cb1993f91ec846d1/bleach-6.2.0.tar.gz" ], - strip_prefix = "bleach-2.0", - sha256 = "789dcf3e7daf79c4c78518c6ebafd51bbaf111ac4263a97c08cf8d6a27eda820", + strip_prefix = "bleach-6.2.0", + sha256 = "123e894118b8a599fd80d3ec1a6d4cc7ce4e5882b1317a7e1ba69b56e95f991f", build_file = str(Label("//third_party:bleach.BUILD")), ) @@ -99,13 +88,3 @@ def tensorboard_python_workspace(): ], ) - http_archive( - name = "org_pythonhosted_six", - urls = [ - "http://mirror.tensorflow.org/pypi.python.org/packages/source/s/six/six-1.13.0.tar.gz", - "https://pypi.python.org/packages/source/s/six/six-1.13.0.tar.gz", - ], - sha256 = "30f610279e8b2578cab6db20741130331735c781b56053c59c4076da27f06b66", - strip_prefix = "six-1.13.0", - build_file = str(Label("//third_party:six.BUILD")), - ) diff --git a/third_party/six.BUILD b/third_party/six.BUILD deleted file mode 100644 index 147193a0300..00000000000 --- a/third_party/six.BUILD +++ /dev/null @@ -1,16 +0,0 @@ -# Description: -# Six provides simple utilities for wrapping over differences between Python 2 -# and Python 3. - -load("@rules_python//python:py_library.bzl", "py_library") - -licenses(["notice"]) # MIT - -exports_files(["LICENSE"]) - -py_library( - name = "org_pythonhosted_six", - srcs = ["six.py"], - srcs_version = "PY3", - visibility = ["//visibility:public"], -) diff --git a/third_party/workspace.bzl b/third_party/workspace.bzl index afe0206f034..a4d268dce68 100644 --- a/third_party/workspace.bzl +++ b/third_party/workspace.bzl @@ -35,12 +35,6 @@ def tensorboard_workspace(name = ""): tensorboard_js_workspace() tensorboard_rust_workspace() - # Protobuf's BUILD file depends on //external:six. - native.bind( - name = "six", - actual = "@org_pythonhosted_six", - ) - # Needed by Protobuf. native.bind( name = "grpc_python_plugin",