default: switch to EntryPoint.resolve#4762
Merged
Conversation
Summary: We use Python [entry points] to discover dynamic plugins and load their entry points using the `load` method. It turns out that this does more than expected: it updates the global working set, analyzes requirements, and throws an error in some cases where it shouldn’t (see #4761). This patch switches `.load()` to `.resolve()`, which [actually just resolves the symbol][resolve]. Fixes #4761. [entry points]: https://packaging.python.org/specifications/entry-points/ [resolve]: https://github.com/pypa/setuptools/blob/b2f7b8f92725c63b164d5776f85e67cc560def4e/pkg_resources/__init__.py#L2452-L2460 Test Plan: Run `//tensorboard/data/server/pip_package:install` to install RustBoard version 0.4.0a0 into a virtualenv with a `tb-nightly` that requires it at version `<0.4.0`. Launch TensorBoard, and note that it no longer fails at startup time with a `VersionConflict` error. wchargin-branch: entrypoint-resolve wchargin-source: 31b009258153da793b87ee6b0bb2cb860600ca53
stephanwlee
approved these changes
Mar 10, 2021
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.
Summary:
We use Python entry points to discover dynamic plugins and load their
entry points using the
loadmethod. It turns out that this does morethan expected: it updates the global working set, analyzes requirements,
and throws an error in some cases where it shouldn’t (see #4761). This
patch switches
.load()to.resolve(), which actually just resolvesthe symbol.
Fixes #4761.
Test Plan:
Run
//tensorboard/data/server/pip_package:installto install RustBoardversion 0.4.0a0 into a virtualenv with a
tb-nightlythat requires itat version
<0.4.0. Launch TensorBoard, and note that it no longerfails at startup time with a
VersionConflicterror.wchargin-branch: entrypoint-resolve