protoprimer¶
Want a one-liner to bootstrap isolated envs for every repo clone?
./prime
Invoke protoprimer - an arg-less stand-alone script that switches:
from chaos (the many conditions in which a user may invoke it)
into order (an env-specific
venvwith the requiredpythonversion)
Eventually, protoprimer transfers control to custom steps for anything else...
provision other SDKs
verify system/user config (local, cloud)
install
githooksgenerate env-specific code
... [you name it]
Why?¶
More than one manual step is tedious and error-prone.
Plus, the single-step bootstrap is a non-trivial "chicken and egg" problem!
[formal proof]
0. You may have a project in any lang.
C++, Java, Go, JS/TS, Rust, Haskell, ...
Next: you may still need to automate with something else...
1. "What is the best glue for automation, if not python?"
readable, testable, modular, cross-platform, ...
huge mind-share, gazillion of packages, ...
Next: you need an isolated venv for dependencies.
2. "I can manage a venv everywhere"
that
venvhas to be created by every usereveryone has to
activateit every time
Next: you need to ensure the required python for venv creation.
3. "I can use uv to ensure the required python version"
everyone has to install the
uvexecutable firsteveryone has to know
uvargs like:
uv pip install --editable path/to/project_1
uv pip install --editable path/to/project_2
...
Next: uv reproduces venv, but steps may go beyond that.
4. "I can wrap it all into a shell script"
This demands logic to handle flexibility:
to load env-specific configuration and respect it
to distinguish an initial bootstrap from a subsequent update
Next: shell is:
untestable
non-modular
platform-dependent
cryptic
...
5. "I can replace shell with a better lang, but which one?"
the lang has to be:
cross-platform
ubiquitous (like
shell)require no explicit compilation
Next: you are in a cycle back to point 1 for python.
You need to break that 5-to-1 loop.
The entry script must evolve through chaos to survive.
In other words, it must become both "the chicken and the egg".
How?¶
To bootstrap, protoprimer restarts, iteratively preparing the environment:
Takes off with a wild
pythonversion (whatever is in thePATHenv var).Switches in-flight to the required
pythonversion.Satisfies a set of DAG-organized pre-conditions on each restart cycle.
Lands inside a comfy isolated
venvwith all dependencies pinned.The custom steps take over here.
The "chicken-egg" can fly reliably because any python is trivial to satisfy.