Skip to content

default: switch to EntryPoint.resolve#4762

Merged
wchargin merged 1 commit intomasterfrom
wchargin-entrypoint-resolve
Mar 10, 2021
Merged

default: switch to EntryPoint.resolve#4762
wchargin merged 1 commit intomasterfrom
wchargin-entrypoint-resolve

Conversation

@wchargin
Copy link
Copy Markdown
Contributor

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
.

Fixes #4761.

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

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
@wchargin wchargin merged commit 58f5f58 into master Mar 10, 2021
@wchargin wchargin deleted the wchargin-entrypoint-resolve branch March 10, 2021 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pkg_resources complains about entry point dependency versions

2 participants