Remove runtime pkg_resources dependency in default and server_ingester#7057
Open
0xmagnus91 wants to merge 1 commit intotensorflow:masterfrom
Open
Remove runtime pkg_resources dependency in default and server_ingester#70570xmagnus91 wants to merge 1 commit intotensorflow:masterfrom
0xmagnus91 wants to merge 1 commit intotensorflow:masterfrom
Conversation
Author
|
Added local validation results while workflow runs are pending maintainer approval for fork PR CI. Local command executed: Result: all 3 targets passed locally. Could a maintainer approve the pending workflow runs so required checks can execute on this PR? Thanks. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation for features / changes
Fixes #7003.
pkg_resourcesis removed in newer setuptools, which can break TensorBoard at import/runtime. This change removes runtime reliance onpkg_resourcesin the two affected code paths.Technical description of changes
tensorboard/default.py:pkg_resources.iter_entry_points(...)importlib.metadata.entry_points(...)with compatibility handling for different Python return shapes.tensorboard/data/server_ingester.py:pkg_resources.parse_version(...)packaging.version.parse(...).tensorboard/default_test.pynow patches_iter_entry_pointsand usesload()-style fake entry points.tensorboard/version_test.pynow validates PEP 440 behavior usingpackaging.version.expect_packaging_installedwherepackagingis now required.Detailed steps to verify changes work correctly (as executed by you)
Executed locally in an isolated venv:
python -m py_compile tensorboard/default.py tensorboard/default_test.py tensorboard/data/server_ingester.py tensorboard/version_test.pyPYTHONPATH=. python tensorboard/version_test.py(passes)Attempted but environment-limited locally:
bazel test //tensorboard:version_test //tensorboard:default_test //tensorboard/data:server_ingester_test(bazel not available in local shell)default_test.pyandserver_ingester_test.pywithout Bazel-generated artifacts hit local environment/import constraints.Alternate designs / implementations considered (or N/A)