Coding Helpers

utils.coding provides repository setup and test running inside a sandbox based on the language of the repo. These are the async functions that the setup_repo and run_tests solvers wrap, exposed directly for use outside a solver.

For example, to setup a python repo and run its tests:

from inspect_toolkit.utils.coding import run_tests, setup_repo

await setup_repo("python", repo_path)                 # install dependencies in the sandbox
result = await run_tests("python", workspace_path)    # -> {"status": ..., "counts": {...}}

Helpers include:

Both functions take the repository language as their first argument and dispatch to the appropriate per-language implementation. The languages currently supported are Python, JavaScript, TypeScript, Java and Go.

See Also