Skip to content
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

Plugin loaders and unified CLI: Replace pkg_resources with importlib.metadata #101

Closed
achimnol opened this issue Jan 15, 2020 · 2 comments
Closed
Labels
area:infrastructure Infrastructure-related issues comp:cli Related to CLI component
Milestone

Comments

@achimnol
Copy link
Member

achimnol commented Jan 15, 2020

pkg_resources is now going to be deprecated, and a recommended replacement is entrypoints, but now the standard library importlib has adopted importlib_metadata as importlib.metadata since Python 3.8 which is available to older Python versions as a PyPI package.

There have been slight performance improvements and newer packages provide better handling of version conflicts (this was actually an unintended side-effect in pkg_resources).

Let's go with importlib.metadata since this will be maintained as a part of Python.

Related: #35

┆Issue is synchronized with this Asana task by Unito

@achimnol achimnol added type:feature Add new features area:infrastructure Infrastructure-related issues labels Jan 15, 2020
achimnol added a commit to lablup/backend.ai-cli that referenced this issue Jan 15, 2020
* Adopt import.metadata (lablup/backend.ai#101)

* Instead of injecting "start-xxx" subcommands into the all existing
  registered command sets, let CLI-enabled packages explicitly declare
  their owner command set using dot-prefix.
  (e.g., "ag.start-server" will be loaded into "ag" command group)
achimnol added a commit to lablup/backend.ai-manager that referenced this issue Jan 15, 2020
achimnol added a commit to lablup/backend.ai-client-py that referenced this issue Jan 15, 2020
@achimnol
Copy link
Member Author

Let's add a cache for entrypoints and provide an explicit refresh command to the cli package for speedup. Currently, regardless of which entrypoint loader is used, it takes about 0.8 to 1.5 seconds for the CLI to start up.

@achimnol achimnol added the comp:cli Related to CLI component label Jan 20, 2020
@achimnol achimnol added this to the 19.12 milestone Jan 20, 2020
@achimnol achimnol mentioned this issue Jan 21, 2020
4 tasks
@achimnol achimnol modified the milestones: 19.12, 20.03 Jul 28, 2020
@achimnol
Copy link
Member Author

This is now done with ai.backend.plugin.entrypoint introduced by #417.

@achimnol achimnol removed the type:feature Add new features label Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:infrastructure Infrastructure-related issues comp:cli Related to CLI component
Projects
None yet
Development

No branches or pull requests

1 participant