Skip to content

Commit

Permalink
Vendor bleach and html5lib in pip package
Browse files Browse the repository at this point in the history
TensorBoard uses bleach, which depends on html5lib, which made a big breaking
change at some point in the past. Since upgrading these dependencies is not
possible, we'll shade them under the `tensorboard._vendor` namespace, which is
magically created by our build_pip_package script, which was rewritten, to
support smoke testing and dash.

The new process for building the TensorBoard pip package is:

```sh
rm -rf /tmp/tensorboard
bazel run //tensorboard/pip_package:build_pip_package
pip install -U /tmp/tensorboard/*py2*.pip
```

Fixes tensorflow/tensorflow#16424
Fixes #427
Fixes #588
Closes #607
Could help #748
  • Loading branch information
jart committed Apr 26, 2018
1 parent 270d34d commit 22d99c0
Show file tree
Hide file tree
Showing 20 changed files with 210 additions and 191 deletions.
2 changes: 1 addition & 1 deletion tensorboard/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ py_library(
],
)

py_binary(
py_library(
name = "version",
srcs = ["version.py"],
srcs_version = "PY2AND3",
Expand Down
17 changes: 0 additions & 17 deletions tensorboard/components/tf_imports/d3.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
<!--
@license
Copyright 2016 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.
-->

<!--
@license
d3
Expand Down
17 changes: 0 additions & 17 deletions tensorboard/components/tf_imports/dagre.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
<!--
@license
Copyright 2016 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.
-->

<!--
@license
Dagre
Expand Down
27 changes: 17 additions & 10 deletions tensorboard/components/tf_imports/graphlib.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
<!--
@license
Copyright 2016 The TensorFlow Authors. All Rights Reserved.
Graphlib
Copyright (c) 2012-2014 Chris Pettitt
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
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
http://www.apache.org/licenses/LICENSE-2.0
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
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.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->

<link rel="import" href="lodash.html">
Expand Down
17 changes: 0 additions & 17 deletions tensorboard/components/tf_imports/lodash.html
Original file line number Diff line number Diff line change
@@ -1,18 +1 @@
<!--
@license
Copyright 2016 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.
-->

<script jscomp-minify src="../lodash/lodash.js"></script>
17 changes: 0 additions & 17 deletions tensorboard/components/tf_imports/numericjs.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
<!--
@license
Copyright 2016 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.
-->

<!--
@license
Numeric Javascript
Expand Down
17 changes: 0 additions & 17 deletions tensorboard/components/tf_imports/plottable.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
<!--
@license
Copyright 2016 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.
-->

<!--
@license
Plottable.js
Expand Down
17 changes: 0 additions & 17 deletions tensorboard/components/tf_imports/threejs.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
<!--
@license
Copyright 2016 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.
-->

<!--
@license
three.js
Expand Down
17 changes: 0 additions & 17 deletions tensorboard/components/tf_imports/weblas.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
<!--
@license
Copyright 2016 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.
-->

<!--
@license
weblas
Expand Down
53 changes: 53 additions & 0 deletions tensorboard/pip_package/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ package(default_visibility = ["//visibility:private"])

licenses(["notice"]) # Apache 2.0

# rm -rf /tmp/tensorboard
# bazel run //tensorboard/pip_package:build_pip_package
# pip install -U /tmp/tensorboard/*py2*.pip
sh_binary(
name = "build_pip_package",
srcs = ["build_pip_package.sh"],
Expand All @@ -20,4 +23,54 @@ sh_binary(
"//tensorboard/plugins/beholder", # User-facing beholder API
"//tensorboard/plugins/projector", # User-facing projector API
],
tags = [
"local",
"manual",
],
)

genrule(
name = "license",
srcs = [
"LICENSE.tensorflow",
"@org_polymer//:LICENSE.txt",
"@com_palantir_plottable//:package/LICENSE",
"@org_d3js//:LICENSE",
"@org_chromium_catapult_vulcanized_trace_viewer//:LICENSE",
"@io_github_cpettitt_dagre//:LICENSE",
"@io_github_cpettitt_graphlib//:LICENSE",
"@io_github_waylonflinn_weblas//:LICENSE",
"@com_numericjs//:license.txt",
"@org_threejs//:LICENSE",
"@com_lodash//:LICENSE",
"@com_google_fonts_roboto//:LICENSE",
"@org_mozilla_bleach//:LICENSE",
"@org_html5lib//:LICENSE",
],
outs = ["LICENSE"],
cmd = "\n".join([
"(",
" echo '#' TensorBoard License",
" echo",
" echo TensorBoard is licensed Apache 2.0 and distributed with",
" echo vendored content licensed Apache 2.0, MIT, and BSD-3.",
" echo",
" echo '##' Table of Contents",
" echo",
" for src in $(SRCS); do",
" echo '-' $$src",
" done",
" echo",
" echo '##' Licenses",
" for src in $(SRCS); do",
" echo",
" echo",
" echo",
" echo '###' $$src",
" echo",
" cat $$src",
" done",
"",
") >$@",
]),
)
File renamed without changes.
4 changes: 3 additions & 1 deletion tensorboard/pip_package/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
recursive-include tensorboard *
include LICENSE
include README.rst
graft tensorboard
Loading

0 comments on commit 22d99c0

Please sign in to comment.