Skip to content
This repository was archived by the owner on Nov 5, 2024. It is now read-only.

Commit f218fb6

Browse files
authored
fix: remove unneeded gptscript dependency (#6)
Signed-off-by: Grant Linville <[email protected]>
1 parent 722b853 commit f218fb6

File tree

3 files changed

+5
-20
lines changed

3 files changed

+5
-20
lines changed

go.mod

-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ require (
66
github.com/adrg/xdg v0.4.0
77
github.com/docker/docker-credential-helpers v0.8.2
88
github.com/glebarez/sqlite v1.11.0
9-
github.com/gptscript-ai/gptscript v0.9.4
109
gorm.io/gorm v1.25.12
1110
k8s.io/apimachinery v0.31.1
1211
k8s.io/apiserver v0.31.1
@@ -20,7 +19,6 @@ require (
2019
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
2120
github.com/cespare/xxhash/v2 v2.3.0 // indirect
2221
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
23-
github.com/docker/cli v26.0.0+incompatible // indirect
2422
github.com/dustin/go-humanize v1.0.1 // indirect
2523
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
2624
github.com/felixge/httpsnoop v1.0.4 // indirect

go.sum

-4
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
1818
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
1919
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
2020
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
21-
github.com/docker/cli v26.0.0+incompatible h1:90BKrx1a1HKYpSnnBFR6AgDq/FqkHxwlUyzJVPxD30I=
22-
github.com/docker/cli v26.0.0+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
2321
github.com/docker/docker-credential-helpers v0.8.2 h1:bX3YxiGzFP5sOXWc3bTPEXdEaZSeVMrFgOr3T+zrFAo=
2422
github.com/docker/docker-credential-helpers v0.8.2/go.mod h1:P3ci7E3lwkZg6XiHdRKft1KckHiO9a2rNtyFbZ/ry9M=
2523
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
@@ -67,8 +65,6 @@ github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af h1:kmjWCqn2qkEml422C2
6765
github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo=
6866
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
6967
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
70-
github.com/gptscript-ai/gptscript v0.9.4 h1:8msPI7zdzNv6kElLqP/mIFFoir2CWbyf+1OJiC479FY=
71-
github.com/gptscript-ai/gptscript v0.9.4/go.mod h1:STd/eyhAkkC0YUL8B0tBs15m+uxm7yliur8HicZJL68=
7268
github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 h1:bkypFPDjIYGfCYD5mRBvpqxfYX1YCS1PXdKYWi8FsN0=
7369
github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0/go.mod h1:P+Lt/0by1T8bfcF3z737NnSbmxQAppXMRziHUxPOC8k=
7470
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=

pkg/sqlite/sqlite.go

+5-14
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010
"github.com/adrg/xdg"
1111
"github.com/docker/docker-credential-helpers/credentials"
1212
"github.com/glebarez/sqlite"
13-
"github.com/gptscript-ai/gptscript/pkg/config"
1413
"gorm.io/gorm"
1514
"gorm.io/gorm/logger"
1615
"k8s.io/apimachinery/pkg/runtime/schema"
@@ -32,20 +31,15 @@ var groupResource = schema.GroupResource{
3231
}
3332

3433
type Sqlite struct {
35-
cfg *config.CLIConfig
3634
db *gorm.DB
3735
transformer value.Transformer
3836
}
3937

4038
func NewSqlite(ctx context.Context) (Sqlite, error) {
41-
// Passing the empty string here will first look for the config location in GPTSCRIPT_CONFIG_FILE.
42-
// If that is not set, it will look at xdg.ConfigFile("gptscript/config.json"), the default location.
43-
cfg, err := config.ReadCLIConfig("")
44-
if err != nil {
45-
return Sqlite{}, fmt.Errorf("error reading CLI config: %w", err)
46-
}
47-
48-
var dbPath string
39+
var (
40+
dbPath string
41+
err error
42+
)
4943
if os.Getenv("GPTSCRIPT_SQLITE_FILE") != "" {
5044
dbPath = os.Getenv("GPTSCRIPT_SQLITE_FILE")
5145
} else {
@@ -69,10 +63,7 @@ func NewSqlite(ctx context.Context) (Sqlite, error) {
6963
return Sqlite{}, fmt.Errorf("failed to auto migrate GptscriptCredential: %w", err)
7064
}
7165

72-
s := Sqlite{
73-
cfg: cfg,
74-
db: db,
75-
}
66+
s := Sqlite{db: db}
7667

7768
encryptionConf, err := readEncryptionConfig(ctx)
7869
if err != nil {

0 commit comments

Comments
 (0)