summaryrefslogtreecommitdiff
path: root/runner/python/filetarget.go
diff options
context:
space:
mode:
Diffstat (limited to 'runner/python/filetarget.go')
-rw-r--r--runner/python/filetarget.go51
1 files changed, 0 insertions, 51 deletions
diff --git a/runner/python/filetarget.go b/runner/python/filetarget.go
deleted file mode 100644
index 6793f4b..0000000
--- a/runner/python/filetarget.go
+++ /dev/null
@@ -1,51 +0,0 @@
-package python
-
-import (
- "os/exec"
- "path/filepath"
- "pik/model"
- "pik/runner"
-)
-
-type FileTarget struct {
- runner.BaseTarget
- File string
-}
-
-type HydratedFileTarget struct {
- runner.BaseHydration[*FileTarget]
-}
-
-func (h *HydratedFileTarget) Icon() string {
- return "\uE606"
-}
-
-func (p *FileTarget) Create(s *model.Source) *exec.Cmd {
- var cmd []string
- if Python.Uv != "" {
- cmd = []string{Python.Uv, "run", "--", p.File}
- } else if venv := Python.VenvFor(s); venv != "" {
- cmd = []string{filepath.Join(s.Path, venv, "bin", "python3"), p.File}
- } else {
- sysPath, err := exec.LookPath("python3")
- if err != nil {
- return nil
- }
- cmd = []string{sysPath, p.File}
- }
- return exec.Command(cmd[0], cmd[1:]...)
-}
-
-func (p *FileTarget) Sub() []string {
- return nil
-}
-
-func (p *FileTarget) Label() string {
- return p.Full
-}
-
-func (p *FileTarget) Hydrate(src *model.Source) (model.HydratedTarget, error) {
- return &HydratedFileTarget{
- BaseHydration: runner.Hydrated(p),
- }, nil
-}