Skip to content

Commit b2c3ba7

Browse files
authored
Merge pull request #2 from gotray/initial
fix ci on windows
2 parents 0ca3cf8 + bdbadfd commit b2c3ba7

File tree

13 files changed

+41
-21
lines changed

13 files changed

+41
-21
lines changed

.github/workflows/go.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,29 @@ jobs:
3131
with:
3232
go-version: 1.23
3333

34+
- uses: actions/setup-python@v5
35+
with:
36+
python-version: '3.13'
37+
update-environment: true
38+
39+
- name: Generate Python pkg-config for windows (patch)
40+
if: matrix.os == 'windows-latest'
41+
run: |
42+
mkdir -p $PKG_CONFIG_PATH
43+
cp .github/assets/python3-embed.pc $PKG_CONFIG_PATH/
44+
45+
- name: Install tiny-pkg-config for windows (patch)
46+
if: matrix.os == 'windows-latest'
47+
run: |
48+
set -x
49+
curl -L https://github.com/cpunion/tiny-pkg-config/releases/download/v0.2.0/tiny-pkg-config_Windows_x86_64.zip -o /tmp/tiny-pkg-config.zip
50+
unzip /tmp/tiny-pkg-config.zip -d $HOME/bin
51+
mv $HOME/bin/tiny-pkg-config.exe $HOME/bin/pkg-config.exe
52+
echo $PKG_CONFIG_PATH
53+
cat $PKG_CONFIG_PATH/python3-embed.pc
54+
pkg-config --libs python3-embed
55+
pkg-config --cflags python3-embed
56+
3457
- name: Build
3558
run: go install -v ./...
3659

cmd/init.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ var initCmd = &cobra.Command{
5454
If no path is provided, it will initialize in the current directory.
5555
5656
Example:
57-
gopy init
58-
gopy init my-project
59-
gopy init --debug my-project
60-
gopy init -v my-project`,
57+
got init
58+
got init my-project
59+
got init --debug my-project
60+
got init -v my-project`,
6161
Run: func(cmd *cobra.Command, args []string) {
6262
// Get project path
6363
projectPath := "."
@@ -111,7 +111,7 @@ Example:
111111
fmt.Printf("\n%s\n", bold("Successfully initialized go-python project in "+projectPath))
112112
fmt.Println("\nNext steps:")
113113
fmt.Println("1. cd", projectPath)
114-
fmt.Println("2. gopy run .")
114+
fmt.Println("2. got run .")
115115
},
116116
}
117117

cmd/internal/create/create.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
"github.com/fatih/color"
1313
)
1414

15-
//go:embed templates/*
15+
//go:embed _templates/*
1616
var templates embed.FS
1717

1818
var (
@@ -52,18 +52,18 @@ func Project(projectPath string, verbose bool) error {
5252
overwriteAll := false
5353

5454
// Walk through template files and copy them
55-
err := fs.WalkDir(templates, "templates", func(path string, d fs.DirEntry, err error) error {
55+
err := fs.WalkDir(templates, "_templates", func(path string, d fs.DirEntry, err error) error {
5656
if err != nil {
5757
return err
5858
}
5959

6060
// Skip the templates root directory
61-
if path == "templates" {
61+
if path == "_templates" {
6262
return nil
6363
}
6464

6565
// Get relative path from templates directory
66-
relPath, err := filepath.Rel("templates", path)
66+
relPath, err := filepath.Rel("_templates", path)
6767
if err != nil {
6868
return err
6969
}

cmd/internal/create/create_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
// setupTestDir creates a temporary directory for testing
1010
func setupTestDir(t *testing.T) string {
1111
t.Helper()
12-
dir, err := os.MkdirTemp("", "gopy-test-*")
12+
dir, err := os.MkdirTemp("", "got-test-*")
1313
if err != nil {
1414
t.Fatalf("failed to create temp dir: %v", err)
1515
}

cmd/internal/install/archive.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ func getCacheDir() (string, error) {
2222
if err != nil {
2323
return "", fmt.Errorf("failed to get user home directory: %v", err)
2424
}
25-
cacheDir := filepath.Join(homeDir, ".gopy", "cache")
25+
cacheDir := filepath.Join(homeDir, ".got", "cache")
2626
if err := os.MkdirAll(cacheDir, 0755); err != nil {
2727
return "", fmt.Errorf("failed to create cache directory: %v", err)
2828
}

cmd/internal/install/deps.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func installGoDeps(projectPath string) error {
5454
}()
5555

5656
fmt.Println("Installing Go dependencies...")
57-
getCmd := exec.Command("go", "get", "-u", "github.com/gotray/go-python")
57+
getCmd := exec.Command("go", "mod", "tidy")
5858
getCmd.Stdout = os.Stdout
5959
getCmd.Stderr = os.Stderr
6060
if err := getCmd.Run(); err != nil {

cmd/internal/install/python_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ func TestGetCacheDir(t *testing.T) {
144144
return
145145
}
146146

147-
want := filepath.Join(tmpDir, ".gopy", "cache")
147+
want := filepath.Join(tmpDir, ".got", "cache")
148148
if got != want {
149149
t.Errorf("getCacheDir() = %v, want %v", got, want)
150150
}

cmd/internal/rungo/run.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func FindProjectRoot(dir string) (string, error) {
7676
}
7777
parentDir := filepath.Dir(dir)
7878
if parentDir == dir {
79-
return "", fmt.Errorf("failed to find Gopy project")
79+
return "", fmt.Errorf("failed to find Got project")
8080
}
8181
return FindProjectRoot(parentDir)
8282
}
@@ -89,7 +89,7 @@ func RunCommand(command string, args []string) error {
8989
}
9090
projectRoot, err := FindProjectRoot(wd)
9191
if err != nil {
92-
return fmt.Errorf("should run this command in a Gopy project: %v", err)
92+
return fmt.Errorf("should run this command in a Got project: %v", err)
9393
}
9494
env.SetBuildEnv(projectRoot)
9595

0 commit comments

Comments
 (0)