Documentation
¶
Overview ¶
Package adkpath locates the Python ADK on the system it is running on.
It exists because two callers need the same answer and neither can import the other: the daemon starts and describes agents through the runner, and the CLI prints the command an operator should run. A second copy of this resolution is a second set of answers, and GAPI-DIV-093 is what that looked like - the CLI printed a checkout-relative path on an installed system, where it resolves to nothing.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PyADK ¶
type PyADK struct {
// Root is the tree containing agent/ and gapi/.
Root string
// Runner is the path to execute; always Root/agent/runner.py.
Runner string
// Source names the tier that produced this, for error messages and
// for the CLI to say where it looked.
Source string
}
PyADK is a located Python ADK tree.
THE ROOT IS THE THING BEING SELECTED, not the runner file, and that is why this carries both (GAPI-DIV-109). runner.py does sys.path.append(dirname(__file__) + "/..") and then imports gapi.native from it, so pointing at the script silently chooses which gapi package - stub or native - gets imported. A variable naming a leaf cannot express "use this ADK" while deciding exactly that, which is the confusion behind GAPI-DIV-085, -086 and operator decisions 30 and 41.
func ResolvePyADK ¶
ResolvePyADK locates the Python ADK tree.
THREE TIERS, IN THE SAME ORDER AND FOR THE SAME REASONS AS pkg/cli.resolveGoADK: an explicit override, then the install layout, then the checkout. The two are deliberately the same shape, because the previous asymmetry was the defect - the Go side walked up and checked every tier while the Python side trusted the working directory and looked for the install tree in a place no layout ever put it.