-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[dg] Warn when package defines entry point but its missing from manifest (BUILD-1030) #29514
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
b448f3f to
8c2fab3
Compare
928ae24 to
f2b4fe1
Compare
5128ede to
485bcfb
Compare
f2b4fe1 to
5238ead
Compare
5238ead to
fc12ece
Compare
485bcfb to
65056ab
Compare
fc12ece to
877f7da
Compare
| def install_editable_dagster_packages_to_venv( | ||
| venv_path: Path, package_rel_paths: Sequence[str] | ||
| ) -> None: | ||
| dagster_git_repo_dir = str(discover_git_root(Path(__file__))) | ||
| install_args: list[str] = [] | ||
| for path in package_rel_paths: | ||
| full_path = Path(dagster_git_repo_dir) / "python_modules" / path | ||
| install_args.extend(["-e", str(full_path)]) | ||
| install_to_venv(venv_path, install_args) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be in test utils? would you use it outside of a test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good call, moved
877f7da to
888d70a
Compare
65056ab to
0e8f88f
Compare
## Summary & Motivation - Change `dagster-components list library` -> `list plugins`. This should have been done when the `dg` command was converted. - The output format has been changed. `list libraries` outputs a `list[PluginObjectSnap]`. `list plugins` outputs a `PluginManifest`. The `PluginManifest` contains a `list[PluginObjectSnap]` but also a list of all modules scanned. This means it contains information about which plugins were scanned but contained no objects. This is useful to detect the situation where a project declares an entry point but it isn't registered (see [upstack](#29514)). - `dg` will detect when it's dealing with a version with `list plugins` or `list libraries` and call the appropriate command. It also normalizes the differing output formats to the same `PluginManifest` format on the `dg` end. ## How I Tested These Changes New unit tests, including backcompat tests.
888d70a to
5c199f0
Compare
## Summary & Motivation - Change `dagster-components list library` -> `list plugins`. This should have been done when the `dg` command was converted. - The output format has been changed. `list libraries` outputs a `list[PluginObjectSnap]`. `list plugins` outputs a `PluginManifest`. The `PluginManifest` contains a `list[PluginObjectSnap]` but also a list of all modules scanned. This means it contains information about which plugins were scanned but contained no objects. This is useful to detect the situation where a project declares an entry point but it isn't registered (see [upstack](#29514)). - `dg` will detect when it's dealing with a version with `list plugins` or `list libraries` and call the appropriate command. It also normalizes the differing output formats to the same `PluginManifest` format on the `dg` end. ## How I Tested These Changes New unit tests, including backcompat tests.
…est (BUILD-1030) (#29514) ## Summary & Motivation Emit a warning when a project defines a `dagster_dg.plugin` entry point, but the targeted module is not present in the `PluginManifest` retrieved via `dagster-components list plugins`. This can help users avoid the frustrating situation where they've defined an entry point but their custom components aren't showing up. The warning is: ``` Your package defines a `dagster_dg.plugin` entry point, but this module was not found in the plugin manifest for the current environment. This means either that your project is not installed in the current environment, or that the entry point metadata was added after your module was installed. Python entry points are registered at package install time. Please reinstall your package into the current environment to ensure the entry point is registered. Entry point module: `foo_bar.lib` ``` ## How I Tested These Changes New unit tests ## Changelog `dg` will now emit a warning prompting the user to reinstall the package if it detects an entry point in project metadata that does not show up when running in `dg list plugins`.

Summary & Motivation
Emit a warning when a project defines a
dagster_dg.pluginentry point, but the targeted module is not present in thePluginManifestretrieved viadagster-components list plugins. This can help users avoid the frustrating situation where they've defined an entry point but their custom components aren't showing up. The warning is:How I Tested These Changes
New unit tests
Changelog
dgwill now emit a warning prompting the user to reinstall the package if it detects an entry point in project metadata that does not show up when running indg list plugins.