turbo-editors/turbo-pythonpublic Fork 0
v1.0.2
Commits
Clone
git clone https://git.rickub.com/turbo-editors/turbo-python.git
git clone ssh://git@rickub.com/turbo-editors/turbo-python.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

tools.toml.tmpl · 95 lines · 3.2 KBCheetah Blame HistoryRaw
📦 Turbo Python 6fc62ea k33g 9h ago1# turbo-python tools.
2#
3# Each [[tool]] becomes one line of the Python menu, in the order they appear
4# here. name is what the menu shows; a letter between tildes is its hot key, and
5# no two tools should claim the same one.
6#
7# command goes to "sh -c", so pipes, globs and && work: one entry can be a
8# whole sequence.
9#
10# menu says which menu it appears in. Leave it out and the tool goes into the
11# Python menu; name anything else and that menu is created for you, in the order
12# the names first appear here. A tool that has nothing to do with Python belongs
13# in one of your own:
14#
15# [[tool]]
16# name = "~E~cho"
17# command = "echo TADA"
18# menu = "Tools"
19#
20# A {{label}} in a command is a value the editor asks for before running it, in
21# a box titled after the tool. The text between the braces is what it asks for:
22#
23# [[tool]]
24# name = "~A~dd a dependency"
25# command = "uv add {{package}}"
26#
27# The value is quoted, so a path with a space in it stays one argument. Add ...
28# inside the braces when you mean several arguments rather than one value:
29#
30# [[tool]]
31# name = "Test ~o~ne"
32# command = "uv run pytest {{extra flags...}}"
33#
34# Double braces, not single. Single ones appear in real commands — awk '{print
35# $1}' and find . -exec rm {} + are both ordinary things to put here — and
36# neither is asking you for anything.
37#
38# output says where what the command prints goes:
39# popup a dialog that fills in as it runs, and says the exit code (default)
40# terminal a terminal window, for anything that reads the keyboard or runs long
41# editor an editing window once it has finished, to search with Ctrl-F
42#
43# Commands run in the directory the editor was started in, which is why they
44# see the whole project when you start from its root.
45#
46# Everything below goes through uv, which creates the environment, resolves the
47# dependencies, and runs the tools inside it — so no command here needs an
48# environment to have been activated first. Replace `uv run x` with `x` if you
49# would rather activate one yourself.
50
51[[tool]]
52name = "~E~nvironment"
53# The one command that has to come first in a new project: it creates the
54# virtual environment everything else runs inside. The name is asked for rather
55# than fixed, because .venv is only the usual answer and not the only one.
56command = "uv venv {{directory, usually .venv}}"
57output = "popup"
58
59[[tool]]
60name = "~S~ync"
61command = "uv sync"
62output = "popup"
63
64[[tool]]
65name = "~F~ormat"
66command = "uv run ruff format ."
67output = "popup"
68
69[[tool]]
70name = "~L~int"
71command = "uv run ruff check ."
72output = "popup"
73
74[[tool]]
75name = "~T~est"
76command = "uv run pytest"
77output = "popup"
78
79[[tool]]
80name = "~R~un"
81command = "uv run {{script}}"
82# A terminal, not a popup: a program that reads the keyboard has to be able to
83# be answered, and one that runs long has to be able to be interrupted. Python
84# scripts are usually both.
85output = "terminal"
86
87# A tool naming a `menu` gets a menu of its own on the bar. Nothing above does,
88# so every tool above is in the Python menu. This one is in a menu called Tools,
89# which appears between Python and Help — that is the whole mechanism.
90
91[[tool]]
92name = "~E~cho"
93command = "echo 🎉 tada!"
94menu = "Tools"
95output = "terminal"