Skip to content

Commit

Permalink
gto register fix for monorepo (#350)
Browse files Browse the repository at this point in the history
  • Loading branch information
aguschin authored Apr 6, 2023
1 parent 737f867 commit 092db44
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions gto/tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
TAG,
VERSION,
Action,
name_to_tag,
tag_re,
tag_to_name,
)
Expand Down Expand Up @@ -60,6 +61,8 @@ def name_tag(
if action not in TagTemplates:
raise UnknownAction(action=action)

artifact = name_to_tag(artifact)

tag = TagTemplates[action].format(artifact=artifact, version=version, stage=stage)
if simple:
return tag
Expand Down
7 changes: 7 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,13 @@ def test_register(repo_with_commit: Tuple[git.Repo, Callable]):
"❌ Supplied version '1.2.3' cannot be parsed\n",
)

_check_successful_cmd(
"register",
["-r", repo.working_dir, "classification/dvclive:models/nn"],
"classification/dvclive=models/nn@v0.0.1",
search_func=_check_output_contains,
)


def test_assign(repo_with_commit: Tuple[git.Repo, Callable]):
repo, write_file = repo_with_commit
Expand Down

0 comments on commit 092db44

Please sign in to comment.