Skip to content

Add some helpful log messages #144

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/cli/gptscript.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ type GPTScript struct {
Output string `usage:"Save output to a file, or - for stdout" short:"o"`
Input string `usage:"Read input from a file (\"-\" for stdin)" short:"f"`
SubTool string `usage:"Use tool of this name, not the first tool in file"`
Assemble bool `usage:"Assemble tool to a single artifact, saved to --output"`
Assemble bool `usage:"Assemble tool to a single artifact, saved to --output" hidden:"true"`
ListModels bool `usage:"List the models available and exit"`
ListTools bool `usage:"List built-in tools and exit"`
Server bool `usage:"Start server"`
Expand Down
1 change: 1 addition & 0 deletions pkg/repos/runtimes/golang/golang.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ func stripGo(env []string) (result []string) {
}

func (r *Runtime) runBuild(ctx context.Context, toolSource, binDir string, env []string) error {
log.Infof("Running go build in %s", toolSource)
cmd := debugcmd.New(ctx, filepath.Join(binDir, "go"), "build", "-o", "bin/gptscript-go-tool")
cmd.Env = stripGo(env)
cmd.Dir = toolSource
Expand Down
1 change: 1 addition & 0 deletions pkg/repos/runtimes/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ func (r *Runtime) getReleaseAndDigest() (string, string, error) {
}

func (r *Runtime) runNPM(ctx context.Context, toolSource, binDir string, env []string) error {
log.Infof("Running npm in %s", toolSource)
cmd := debugcmd.New(ctx, filepath.Join(binDir, "npm"), "install")
cmd.Env = env
cmd.Dir = toolSource
Expand Down
2 changes: 2 additions & 0 deletions pkg/repos/runtimes/python/python.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func (r *Runtime) Supports(cmd []string) bool {
}

func (r *Runtime) installVenv(ctx context.Context, binDir, venvPath string) error {
log.Infof("Creating virtualenv in %s", venvPath)
cmd := debugcmd.New(ctx, filepath.Join(binDir, "uv"), "venv", "-p",
filepath.Join(binDir, "python3"), venvPath)
return cmd.Run()
Expand Down Expand Up @@ -105,6 +106,7 @@ func (r *Runtime) getReleaseAndDigest() (string, string, error) {
}

func (r *Runtime) runPip(ctx context.Context, toolSource, binDir string, env []string) error {
log.Infof("Running pip in %s", toolSource)
for _, req := range []string{"requirements-gptscript.txt", "requirements.txt"} {
reqFile := filepath.Join(toolSource, req)
if s, err := os.Stat(reqFile); err == nil && !s.IsDir() {
Expand Down