Skip to content

Commit cab431e

Browse files
committed
integrations: python: uv + venv.mx
1 parent 50b3943 commit cab431e

File tree

3 files changed

+59
-2
lines changed

3 files changed

+59
-2
lines changed

app/app.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const Name = "murex"
1717
const (
1818
Major = 7
1919
Minor = 2
20-
Revision = 63
20+
Revision = 64
2121
)
2222

2323
var (

integrations/python_any.mx

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
if { os posix } then {
2+
function venv.mx {
3+
# Enter a Python virtual environment from a Murex shell
4+
5+
venv = $1 ?? ".venv/bin/activate"
6+
7+
out "Entering venv: $(venv)..."
8+
9+
out "
10+
config set shell prompt '{
11+
out %((venv) \$PWD[-1] {BLUE}»{RESET} )
12+
}'
13+
config set shell prompt-multiline '{
14+
len = \${pwd_short -> [-1] -> count --bytes} - 1
15+
printf %((venv) %\${\$len}s » ) \$linenum
16+
}'
17+
out 'Type `exit` or ctrl+d to return'
18+
" -> tmp -> set murex_init
19+
20+
bash -c %(
21+
source $venv
22+
$MUREX_EXE -quiet -ignore-whatsnew -i -execute source $murex_init
23+
)
24+
}
25+
}
26+
27+
if { which uv } then {
28+
summary uv ${ uv --help -> [..1] }
29+
30+
autocomplete set uv %[
31+
{
32+
DynamicDesc: '{ uv --help -> tabulate --column-wraps --split-comma --map --key-inc-hint }'
33+
DynamicPreview: '{ uv --help }'
34+
#AllowMultiple: true
35+
AllowAny: true
36+
}
37+
{
38+
DynamicDesc: '{ uv $1 --help -> tabulate --column-wraps --split-comma --map --key-inc-hint }'
39+
DynamicPreview: '{ uv help $1 }'
40+
AllowMultiple: true
41+
AllowAny: true
42+
}
43+
]
44+
}
45+
46+
if { which uvx } then {
47+
summary uvx ${ uvx --help -> [..1] }
48+
49+
autocomplete set uvx %[
50+
{
51+
DynamicDesc: '{ uvx --help -> tabulate --column-wraps --split-comma --map --key-inc-hint }'
52+
DynamicPreview: '{ uv --help }'
53+
AllowMultiple: true
54+
AllowAny: true
55+
}
56+
]
57+
}

version.svg

Lines changed: 1 addition & 1 deletion
Loading

0 commit comments

Comments
 (0)