Use Venv

Prefer the repository .venv Python interpreter for Python commands, tests, scripts, package tooling, and AI coding workflows when .venv exists.

ok-oldking 1ff69b5 865 B Updated

File contents

Use Repository Virtual Environment

When running Python commands in this repository, use the local virtual environment if it exists.

PowerShell

Before Python commands, resolve the interpreter:

$py = if (Test-Path .\.venv\Scripts\python.exe) { ".\.venv\Scripts\python.exe" } else { "python" }

Then run commands through that interpreter:

& $py -m py_compile ok\util\logger.py
& $py -m pytest tests
& $py .\.agents\skills\compile_i18n\add_translation.py --help
& $py -m pip install -r requirements.txt

Do not call global python, pip, or pytest directly when .venv exists. Use & $py, & $py -m pip, and & $py -m pytest instead.

ok-oldking/ok-script/tree/main/.agents/skills/use_venv commit 1ff69b5671

Frequently asked questions

npx skillmds@latest add ok-oldking/use-venv