This repository was archived by the owner on Sep 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feature/client
- Loading branch information
Showing
40 changed files
with
808 additions
and
384 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -138,3 +138,5 @@ dmypy.json | |
cython_debug/ | ||
|
||
.idea | ||
|
||
mlem/_mlem_version.py |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
from typer import Argument, Typer | ||
|
||
from mlem.cli.main import MlemGroupSection, app, mlem_command | ||
from mlem.ext import MLEM_ENTRY_POINT, find_implementations, load_entrypoints | ||
from mlem.ui import echo | ||
|
||
dev = Typer(name="dev", cls=MlemGroupSection("common"), hidden=True) | ||
app.add_typer(dev) | ||
|
||
|
||
@dev.callback() | ||
def dev_callback(): | ||
"""Developer utility tools""" | ||
|
||
|
||
@mlem_command(parent=dev, aliases=["fi"]) | ||
def find_implementations_diff( | ||
root: str = Argument(MLEM_ENTRY_POINT, help="root entry point") | ||
): | ||
"""Loads `root` module or package and finds implementations of MLEM base classes | ||
Shows differences between what was found and what is registered in entrypoints | ||
Examples: | ||
$ mlem dev fi | ||
""" | ||
exts = {e.entry for e in load_entrypoints().values()} | ||
impls = set(find_implementations(root)[MLEM_ENTRY_POINT]) | ||
extra = exts.difference(impls) | ||
if extra: | ||
echo("Remove implementations:") | ||
echo("\n".join(extra)) | ||
new = impls.difference(exts) | ||
if new: | ||
echo("Add implementations:") | ||
echo("\n".join(new)) |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.