app_env
def app_env(
name, default:NoneType=None
):What the environment holds for env_name(name), asked now rather than at import.
Select the Python interpreter for a folder and build the environment for its child processes.
use_app sets the application name and environment-variable prefix used by Kunda defaults.
What the environment holds for env_name(name), asked now rather than at import.
name under the host’s prefix, so MAX_KERNELS is KUNDA_MAX_KERNELS by default.
Name the host application, so what kunda reads and what it says are spelled the host’s way.
VENV_PYTHONS lists common virtual-environment interpreter paths in lookup order.
('.venv/bin/python',
'.venv/Scripts/python.exe',
'venv/bin/python',
'venv/Scripts/python.exe')
BUNDLE_ONLY lists interpreter variables inherited from a frozen application.
Strip py2app/py2exe bundle vars from env; no-op outside a bundle.
strip_bundle removes frozen-application interpreter variables. Other environments are unchanged.
{'PATH': '/usr/bin', 'HOME': '/Users/me', 'PYTHONUTF8': '1'}
The returned environment enables UTF-8 mode.
clean_env applies strip_bundle to the current process environment.
env (this process’s, by default) with python’s virtual environment in front of it.
venv_env puts the selected virtual environment first on PATH and sets VIRTUAL_ENV.
('/repo/.venv', '/repo/.venv/bin:/usr/bin')
Walk up from start to stop, return (dir, marker) for the first dir holding a marker.
nearest_marked walks from start toward its parents. It returns the first directory containing one of markers.
The nearest conventional venv interpreter at or above start, not searched past stop.
The first conventional project-local virtualenv interpreter among roots, or None.
The lookup helpers use the same marker and path rules.
'/proj/repo/.venv/bin/python'
The nearest virtual environment wins. A nested checkout can use its own interpreter.
Pick interpreter for cwd: walk up to stop, then default, then first venv in roots; None means use current.
python_for returns the interpreter used for processes started from a folder. stop limits the parent search.
Kernel launch options: this interpreter (current) and all reachable venvs.current is resolved by python_for and may be deeper than standard search.Listing enables picker selection.
find_pythons returns interpreters for a picker. It removes duplicate paths.