Skip to content

Commit c4c1073

Browse files
Show local checkout and revs in kup list (#102)
1 parent ce0ef3d commit c4c1073

2 files changed

Lines changed: 13 additions & 10 deletions

File tree

src/kup/__main__.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ def package_metadata_tree(
179179
if lbl is None:
180180
tree = Tree('Inputs:')
181181
else:
182-
rev = f' - github:{p.org}/{p.repo}' if type(p) == PackageMetadata else ''
182+
rev = f' - github:{p.org}/{p.repo} \033[3m({p.rev[:7]})\033[0m' if type(p) == PackageMetadata else ''
183183
follows = (' - follows [green]' + '/'.join(p.follows)) if type(p) == Follows else ''
184184
status = ''
185185
if show_status and type(p) == PackageMetadata:
@@ -197,7 +197,6 @@ def package_metadata_tree(
197197
status = f' 🟠 {idx} versions behind master '
198198
else:
199199
status = f' 🔴 {idx} versions behind master'
200-
201200
if status != '':
202201
tree = Tree(Columns([Align(f'{lbl}{rev}{follows}'), Align(status, align='right')], expand=True))
203202
else:
@@ -367,7 +366,11 @@ def list_package(package_name: str, show_inputs: bool, show_status: bool) -> Non
367366
table_data = [['Package name (alias)', 'Installed version', 'Status'],] + [
368367
[
369368
str(PackageName(alias, p.package_name.ext).pretty_name),
370-
f'{p.commit}{" (" + p.tag + ")" if p.tag else ""}' if type(p) == ConcretePackage else '',
369+
f'{p.commit}{" (" + p.tag + ")" if p.tag else ""}'
370+
if type(p) == ConcretePackage
371+
else '\033[3mlocal checkout\033[0m'
372+
if type(p) == LocalPackage
373+
else '',
371374
p.status if type(p) == ConcretePackage else AVAILABLE,
372375
]
373376
for alias, p in packages.items()

src/kup/list-help.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@ Adding the `--inputs` flag will print out the dependency tree of the given packa
4949
```
5050
➜ kup list kevm --inputs
5151
Inputs:
52-
├── blockchain-k-plugin - github:runtimeverification/blockchain-k-plugin 8fdc74e
52+
├── blockchain-k-plugin - github:runtimeverification/blockchain-k-plugin (8fdc74e)
5353
├── haskell-backend - follows k-framework/haskell-backend
54-
├── k-framework - github:runtimeverification/k 43f56ac
55-
│ ├── haskell-backend - github:runtimeverification/haskell-backend 4c3c436
56-
│ ├── llvm-backend - github:runtimeverification/llvm-backend 94e8f4b
57-
│ │ └── immer-src - github:runtimeverification/immer 198c2ae
58-
│ └── rv-utils - github:runtimeverification/rv-nix-tools 7026604
54+
├── k-framework - github:runtimeverification/k (43f56ac)
55+
│ ├── haskell-backend - github:runtimeverification/haskell-backend (4c3c436)
56+
│ ├── llvm-backend - github:runtimeverification/llvm-backend (94e8f4b)
57+
│ │ └── immer-src - github:runtimeverification/immer (198c2ae)
58+
│ └── rv-utils - github:runtimeverification/rv-nix-tools (7026604)
5959
├── pyk - github:runtimeverification/pyk 4240899
60-
└── rv-utils_2 - github:runtimeverification/rv-nix-tools 7026604
60+
└── rv-utils_2 - github:runtimeverification/rv-nix-tools (7026604)
6161
```
6262

6363
`kup` allows any of these dependencies to be overridden when installing, updating or opening a temporary shell. For example, to override the `llvm-backend` dependency, you can do a local checkout of [github.com/runtimeverification/llvm-backend](github.com/runtimeverification/llvm-backend) and then build `kevm` against the checkout via

0 commit comments

Comments
 (0)