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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ jobs:
fail-fast: false
matrix:
mode: ['native']
platform: ['ubuntu-22.04', 'macos-13']
platform: ['ubuntu-22.04']
rust_version: ['1.65.0']
include:
- mode: 'universal'
Expand Down
39 changes: 24 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
"devDependencies": {
"@angular-devkit/build-angular": "^15.2.9",
"@angular/build-tooling": "https://github.com/angular/dev-infra-private-build-tooling-builds.git#fb42478534df7d48ec23a6834fea94a776cb89a0",
"@angular/cli": "^15.2.9",
"@angular/compiler": "15.2.9",
"@angular/compiler-cli": "^15.2.9",
"@angular/cli": "^16.2.0",
"@angular/compiler": "16.2.12",
"@angular/compiler-cli": "^16.2.12",
"@babel/core": "^7.16.12",
"@bazel/concatjs": "5.7.0",
"@bazel/esbuild": "5.7.0",
Expand Down Expand Up @@ -65,16 +65,16 @@
"yarn-deduplicate": "^5.0.0"
},
"dependencies": {
"@angular/animations": "^15.2.9",
"@angular/cdk": "^15.2.9",
"@angular/common": "15.2.9",
"@angular/core": "^15.2.9",
"@angular/forms": "^15.2.9",
"@angular/localize": "^15.2.9",
"@angular/material": "^15.2.9",
"@angular/platform-browser": "^15.2.9",
"@angular/platform-browser-dynamic": "^15.2.9",
"@angular/router": "^15.2.9",
"@angular/animations": "^16.2.12",
"@angular/cdk": "^16.2.14",
"@angular/common": "16.2.12",
"@angular/core": "^16.2.12",
"@angular/forms": "^16.2.12",
"@angular/localize": "^16.2.12",
"@angular/material": "^16.2.14",
"@angular/platform-browser": "^16.2.12",
"@angular/platform-browser-dynamic": "^16.2.12",
"@angular/router": "^16.2.12",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NgRx 15 kept with Angular 16 upgrade

Medium Severity

Angular packages are upgraded from 15.x to 16.x, but @ngrx/store and @ngrx/effects remain at ^15.4.0. NgRx 15 officially supports only Angular 15, creating a peer dependency mismatch. The test files already show symptoms of this — the spyOn(store, 'dispatch') calls now require explicit as jasmine.Spy casts to work around type incompatibilities between NgRx 15's dispatch signature and Angular 16. This is an unsupported configuration that may break with patch-level updates.

Additional Locations (2)

Fix in Cursor Fix in Web

"@ngrx/effects": "^15.4.0",
"@ngrx/store": "^15.4.0",
"@polymer/decorators": "^3.0.0",
Expand Down Expand Up @@ -131,6 +131,15 @@
"three": "~0.137.0",
"umap-js": "^1.3.2",
"web-animations-js": "^2.3.2",
"zone.js": "^0.12.0"
}
"zone.js": "^0.13.3"
},
"resolutions": {
"@types/d3-brush": "1.1.8",
"@types/d3-axis": "1.0.19",
"@types/d3-transition": "1.3.6",
"@types/d3-zoom": "1.8.7",
"@types/d3-drag": "1.2.8",
"@types/d3-scale-chromatic": "1.5.4"
},
"packageManager": "yarn@1.22.22"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
diff --git a/node_modules/@angular/build-tooling/shared-scripts/angular-optimization/BUILD.bazel b/node_modules/@angular/build-tooling/shared-scripts/angular-optimization/BUILD.bazel
index d5a8645..4b57378 100755
--- a/node_modules/@angular/build-tooling/shared-scripts/angular-optimization/BUILD.bazel
+++ b/node_modules/@angular/build-tooling/shared-scripts/angular-optimization/BUILD.bazel
@@ -23,6 +23,7 @@ js_library(
deps = [
"@npm//@babel/core",
"@npm//@babel/helper-annotate-as-pure",
+ "@npm//@babel/helper-split-export-declaration",
],
)

diff --git a/node_modules/@angular/build-tooling/shared-scripts/angular-optimization/esbuild-plugin.mjs b/node_modules/@angular/build-tooling/shared-scripts/angular-optimization/esbuild-plugin.mjs
index 57cd2b9..2e5eaf1 100755
--- a/node_modules/@angular/build-tooling/shared-scripts/angular-optimization/esbuild-plugin.mjs
Expand Down
30 changes: 30 additions & 0 deletions patches/@bazel+concatjs+5.7.0.patch
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
diff --git a/node_modules/@bazel/concatjs/internal/common/compilation.bzl b/node_modules/@bazel/concatjs/internal/common/compilation.bzl
index fed787a..377915a 100755
--- a/node_modules/@bazel/concatjs/internal/common/compilation.bzl
+++ b/node_modules/@bazel/concatjs/internal/common/compilation.bzl
@@ -160,25 +160,11 @@ def _outputs(ctx, label, srcs_files = []):
closure_js_file = ctx.actions.declare_file(basename + ".mjs")
closure_js_files.append(closure_js_file)

- # Temporary until all imports of ngfactory/ngsummary files are removed
- # TODO(alexeagle): clean up after Ivy launch
- if getattr(ctx.attr, "use_angular_plugin", False):
- closure_js_files.append(ctx.actions.declare_file(basename + ".ngfactory.mjs"))
- closure_js_files.append(ctx.actions.declare_file(basename + ".ngsummary.mjs"))
-
if not is_dts:
devmode_js_file = ctx.actions.declare_file(basename + ".js")
devmode_js_files.append(devmode_js_file)
transpilation_infos.append(struct(closure = closure_js_file, devmode = devmode_js_file))
declaration_files.append(ctx.actions.declare_file(basename + ".d.ts"))
-
- # Temporary until all imports of ngfactory/ngsummary files are removed
- # TODO(alexeagle): clean up after Ivy launch
- if getattr(ctx.attr, "use_angular_plugin", False):
- devmode_js_files.append(ctx.actions.declare_file(basename + ".ngfactory.js"))
- devmode_js_files.append(ctx.actions.declare_file(basename + ".ngsummary.js"))
- declaration_files.append(ctx.actions.declare_file(basename + ".ngfactory.d.ts"))
- declaration_files.append(ctx.actions.declare_file(basename + ".ngsummary.d.ts"))
return struct(
closure_js = closure_js_files,
devmode_js = devmode_js_files,
diff --git a/node_modules/@bazel/concatjs/web_test/karma.conf.js b/node_modules/@bazel/concatjs/web_test/karma.conf.js
index 90a03ef..28778c9 100755
--- a/node_modules/@bazel/concatjs/web_test/karma.conf.js
Expand Down
4 changes: 4 additions & 0 deletions patches/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
We use [patch-package](https://www.npmjs.com/package/patch-package) to apply
TensorBoard-specific patches to some of our npm/yarn dependencies.

After creating or updating a patch, ensure there is no trailing whitespace on
any line (CI runs `./tensorboard/tools/whitespace_hygiene_test.py`). You can
strip it with `sed -i '' 's/[[:space:]]*$//' patches/<patch-file>.patch`.

To regenerate @bazel/concatjs patch:
* `vi node_modules/@bazel/concatjs/web_test/karma.conf.js`
* make edits
Expand Down
12 changes: 5 additions & 7 deletions tensorboard/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,6 @@ py_library(
srcs = ["default.py"],
srcs_version = "PY3",
deps = [
"//tensorboard:expect_pkg_resources_installed",
"//tensorboard/backend:experimental_plugin",
"//tensorboard/plugins/audio:audio_plugin",
"//tensorboard/plugins/core:core_plugin",
Expand Down Expand Up @@ -347,7 +346,6 @@ py_test(
deps = [
":default",
":test",
"//tensorboard:expect_pkg_resources_installed",
"//tensorboard/plugins:base_plugin",
],
)
Expand All @@ -367,7 +365,7 @@ py_test(
deps = [
":test",
":version",
"//tensorboard:expect_pkg_resources_installed",
"//tensorboard:expect_packaging_installed",
],
)

Expand Down Expand Up @@ -461,10 +459,10 @@ py_library(name = "expect_absl_logging_installed")
# `pip install absl-py`
py_library(name = "expect_absl_testing_absltest_installed")

# This is a dummy rule used as a pkg-resources dependency in open-source.
# We expect pkg-resources to already be installed on the system, e.g., via
# `pip install setuptools`.
py_library(name = "expect_pkg_resources_installed")
# This is a dummy rule used as a packaging dependency in open-source.
# We expect packaging to already be installed on the system, e.g. via
# `pip install packaging`.
py_library(name = "expect_packaging_installed")

# This is a dummy rule used as a pandas dependency in open-source.
# We expect pandas to already be installed on the system, e.g. via
Expand Down
2 changes: 1 addition & 1 deletion tensorboard/data/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ py_library(
":grpc_provider",
":ingester",
"//tensorboard:expect_grpc_installed",
"//tensorboard:expect_pkg_resources_installed",
"//tensorboard:expect_packaging_installed",
"//tensorboard/data/proto:protos_all_py_pb2",
"//tensorboard/util:tb_logging",
],
Expand Down
11 changes: 4 additions & 7 deletions tensorboard/data/server_ingester.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,13 @@
import time

import grpc
import pkg_resources
from packaging import version as packaging_version

from tensorboard.data import grpc_provider
from tensorboard.data import ingester
from tensorboard.data.proto import data_provider_pb2
from tensorboard.util import tb_logging


logger = tb_logging.get_logger()

# If this environment variable is non-empty, it will be used as the path to the
Expand Down Expand Up @@ -202,7 +201,7 @@ def _maybe_read_file(path):


def _make_stub(addr, channel_creds_type):
(creds, options) = channel_creds_type.channel_config()
creds, options = channel_creds_type.channel_config()
options.append(("grpc.max_receive_message_length", 1024 * 1024 * 256))
channel = grpc.secure_channel(addr, creds, options=options)
return grpc_provider.make_stub(channel)
Expand Down Expand Up @@ -231,9 +230,7 @@ def __init__(self, path, version):
"""
self._path = path
self._version = (
pkg_resources.parse_version(version)
if version is not None
else version
packaging_version.parse(version) if version is not None else version
)

@property
Expand All @@ -260,7 +257,7 @@ def at_least_version(self, required_version):
"""
if self._version is None:
return True
return self._version >= pkg_resources.parse_version(required_version)
return self._version >= packaging_version.parse(required_version)


def get_server_binary():
Expand Down
22 changes: 14 additions & 8 deletions tensorboard/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@
for less repetition.
"""


import logging

import pkg_resources
from importlib import metadata

from tensorboard.plugins.audio import audio_plugin
from tensorboard.plugins.core import core_plugin
Expand All @@ -46,7 +44,6 @@
from tensorboard.plugins.mesh import mesh_plugin
from tensorboard.plugins.wit_redirect import wit_redirect_plugin


logger = logging.getLogger(__name__)


Expand Down Expand Up @@ -119,8 +116,17 @@ def get_dynamic_plugins():
[1]: https://packaging.python.org/specifications/entry-points/
"""
return [
entry_point.resolve()
for entry_point in pkg_resources.iter_entry_points(
"tensorboard_plugins"
)
entry_point.load()
for entry_point in _iter_entry_points("tensorboard_plugins")
]


def _iter_entry_points(group):
"""Returns entry points for a given group across Python versions."""
entry_points = metadata.entry_points()
# In newer Python versions, `metadata.entry_points()` returns an
# `EntryPoints` object with a `select()` method.
# Before "selectable" entry points existed, it would return a dictionary.
if hasattr(entry_points, "select"):
return entry_points.select(group=group)
return entry_points.get(group, ())
40 changes: 9 additions & 31 deletions tensorboard/default_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,52 +14,30 @@
# ==============================================================================
"""Unit tests for `tensorboard.default`."""


from unittest import mock

import pkg_resources

from tensorboard import default
from tensorboard.plugins import base_plugin
from tensorboard import test


class FakePlugin(base_plugin.TBPlugin):
"""FakePlugin for testing."""

plugin_name = "fake"


class FakeEntryPoint(pkg_resources.EntryPoint):
"""EntryPoint class that fake loads FakePlugin."""

@classmethod
def create(cls):
"""Creates an instance of FakeEntryPoint.

Returns:
instance of FakeEntryPoint
"""
return cls("foo", "bar")

def resolve(self):
"""Returns FakePlugin instead of resolving module.
class FakeEntryPoint:
def __init__(self, value):
self._value = value

Returns:
FakePlugin
"""
return FakePlugin
def load(self):
return self._value


class DefaultTest(test.TestCase):
@mock.patch.object(pkg_resources, "iter_entry_points")
@mock.patch.object(default, "_iter_entry_points")
def test_get_dynamic_plugin(self, mock_iter_entry_points):
mock_iter_entry_points.return_value = [FakeEntryPoint.create()]
fake_plugin = object()
mock_iter_entry_points.return_value = [FakeEntryPoint(fake_plugin)]

actual_plugins = default.get_dynamic_plugins()

mock_iter_entry_points.assert_called_with("tensorboard_plugins")
self.assertEqual(actual_plugins, [FakePlugin])
self.assertEqual(actual_plugins, [fake_plugin])


if __name__ == "__main__":
Expand Down
4 changes: 2 additions & 2 deletions tensorboard/defs/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,8 @@ def tf_ng_web_test_suite(name, deps = [], **kwargs):
name = name,
bootstrap =
[
"@npm//:node_modules/zone.js/dist/zone-evergreen.js",
"@npm//:node_modules/zone.js/dist/zone-testing.js",
"@npm//:node_modules/zone.js/bundles/zone.umd.js",
"@npm//:node_modules/zone.js/bundles/zone-testing.umd.js",
"@npm//:node_modules/reflect-metadata/Reflect.js",
],
# The only dependency is the esbuild bundle from spec_bundle().
Expand Down
2 changes: 1 addition & 1 deletion tensorboard/plugins/mesh/tf_mesh_dashboard/mesh-viewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ limitations under the License.
*/

import * as THREE from 'three';
import {OrbitControls} from 'three/examples/jsm/controls/OrbitControls';
import {OrbitControls} from 'three/examples/jsm/controls/OrbitControls.js';

interface LayerConfig {
showBoundingBox?: boolean;
Expand Down
2 changes: 1 addition & 1 deletion tensorboard/plugins/projector/vz_projector/scatterPlot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
import * as THREE from 'three';
import {OrbitControls} from 'three/examples/jsm/controls/OrbitControls';
import {OrbitControls} from 'three/examples/jsm/controls/OrbitControls.js';
import {ProjectorEventContext} from './projectorEventContext';
import {CameraType, LabelRenderParams, RenderContext} from './renderContext';
import {
Expand Down
23 changes: 6 additions & 17 deletions tensorboard/version_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.


import pkg_resources
from packaging import version as packaging_version

from tensorboard import test as tb_test
from tensorboard import version
Expand All @@ -22,22 +22,11 @@
class VersionTest(tb_test.TestCase):
def test_valid_pep440_version(self):
"""Ensure that our version is PEP 440-compliant."""
# pkg_resources.parse_version() doesn't have a public return type,
# so we get a handle to it by parsing known good and bad versions.
#
# Note: depending on the version of the module (which is bundled
# with setuptools), when called with a non-compliant version, it
# either returns a `LegacyVersion` (setuptools < 66) or raises an
# `InvalidVersion` exception (setuptools >= 66). Handle both cases.
compliant_version = pkg_resources.parse_version("1.0.0")
try:
legacy_version = pkg_resources.parse_version("arbitrary string")
except Exception:
legacy_version = None
self.assertNotEqual(type(compliant_version), type(legacy_version))

tensorboard_version = pkg_resources.parse_version(version.VERSION)
self.assertIsInstance(tensorboard_version, type(compliant_version))
with self.assertRaises(packaging_version.InvalidVersion):
packaging_version.parse("arbitrary string")

tensorboard_version = packaging_version.parse(version.VERSION)
self.assertIsInstance(tensorboard_version, packaging_version.Version)


if __name__ == "__main__":
Expand Down
Loading
Loading