Skip to content

Commit

Permalink
support specifying a name on cmdline building
Browse files Browse the repository at this point in the history
  • Loading branch information
lilydjwg committed Jun 28, 2024
1 parent ef508b9 commit b10eb92
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
6 changes: 5 additions & 1 deletion lilac
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,11 @@ def main_may_raise(

if pkgs_from_args:
for p in pkgs_from_args:
build_reasons[p].append(BuildReason.Cmdline())
if ':' in p:
p, runner = p.split(':', 1)
else:
runner = None
build_reasons[p].append(BuildReason.Cmdline(runner))

for p in need_rebuild_pkgrel:
build_reasons[p].append(BuildReason.UpdatedPkgrel())
Expand Down
12 changes: 10 additions & 2 deletions lilac2/nomypy.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# type: ignore

from typing import Union
from typing import Union, Optional

from .typing import OnBuildEntry

Expand Down Expand Up @@ -96,7 +96,15 @@ class FailedByDeps(BuildReason):
def __init__(self, deps: tuple[str]) -> None:
self.deps = deps

class Cmdline(BuildReason): pass
class Cmdline(BuildReason):
def __init__(self, runner: Optional[str]) -> None:
self.runner = runner

def _extra_info(self) -> str:
if self.runner:
return repr(self.runner)
else:
return ''

class OnBuild(BuildReason):
def __init__(self, update_on_build: list[OnBuildEntry]) -> None:
Expand Down

0 comments on commit b10eb92

Please sign in to comment.