mirror of https://github.com/databricks/cli.git
parent
8f4461904b
commit
6d04eb0f0c
2
go.mod
2
go.mod
|
@ -4,7 +4,7 @@ go 1.18
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/atotto/clipboard v0.1.4
|
github.com/atotto/clipboard v0.1.4
|
||||||
github.com/databricks/databricks-sdk-go v0.1.2-0.20221219172754-c59e38647f3f
|
github.com/databricks/databricks-sdk-go v0.2.0
|
||||||
github.com/ghodss/yaml v1.0.0 // MIT + NOTICE
|
github.com/ghodss/yaml v1.0.0 // MIT + NOTICE
|
||||||
github.com/manifoldco/promptui v0.9.0 // BSD-3-Clause license
|
github.com/manifoldco/promptui v0.9.0 // BSD-3-Clause license
|
||||||
github.com/mitchellh/go-homedir v1.1.0 // MIT
|
github.com/mitchellh/go-homedir v1.1.0 // MIT
|
||||||
|
|
4
go.sum
4
go.sum
|
@ -28,8 +28,8 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk
|
||||||
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
|
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
|
||||||
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
||||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||||
github.com/databricks/databricks-sdk-go v0.1.2-0.20221219172754-c59e38647f3f h1:Mfq6euTxxWa9wDyskWcC4zruT9bK6BlNhulgoAVsICk=
|
github.com/databricks/databricks-sdk-go v0.2.0 h1:wPdLoXQ+RVhwxk+7DxuScQryTC6ISgaKublANXcRM2Q=
|
||||||
github.com/databricks/databricks-sdk-go v0.1.2-0.20221219172754-c59e38647f3f/go.mod h1:5eV3o1zUxwkuQKiIOGAVNwK6zGAklnjz4G6uYNO9W8U=
|
github.com/databricks/databricks-sdk-go v0.2.0/go.mod h1:5eV3o1zUxwkuQKiIOGAVNwK6zGAklnjz4G6uYNO9W8U=
|
||||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
|
|
|
@ -3,12 +3,14 @@ package python
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"io"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/databricks/bricks/project"
|
"github.com/databricks/bricks/project"
|
||||||
|
"github.com/databricks/databricks-sdk-go/service/dbfs"
|
||||||
)
|
)
|
||||||
|
|
||||||
func BuildWheel(ctx context.Context, dir string) (string, error) {
|
func BuildWheel(ctx context.Context, dir string) (string, error) {
|
||||||
|
@ -67,8 +69,11 @@ func UploadWheelToDBFSWithPEP503(ctx context.Context, dir string) (string, error
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
defer wf.Close()
|
defer wf.Close()
|
||||||
// err = dbfs.Create(dbfsLoc, raw, true)
|
h, err := wsc.Dbfs.Open(ctx, dbfsLoc, dbfs.FileModeOverwrite|dbfs.FileModeWrite)
|
||||||
err = wsc.Dbfs.Overwrite(ctx, dbfsLoc, wf)
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
_, err = io.Copy(h, wf)
|
||||||
// TODO: maintain PEP503 compliance and update meta-files:
|
// TODO: maintain PEP503 compliance and update meta-files:
|
||||||
// ${DBFSWheelLocation}/index.html and ${DBFSWheelLocation}/${NormalizedName}/index.html
|
// ${DBFSWheelLocation}/index.html and ${DBFSWheelLocation}/${NormalizedName}/index.html
|
||||||
return dbfsLoc, err
|
return dbfsLoc, err
|
||||||
|
|
Loading…
Reference in New Issue