Skip to content

Commit 7bd7360

Browse files
authored
main,bind,_examples: fix tests for go 1.16
* main,bind,_examples: fix tests for go 1.16 This CL fixes a number of tests that are failing under go 1.16. Modules behave a bit differently, the //comment directives now need a space, generated version file needs go fmt, and there was a mis-named symbol * ci: Update travis and appveyor for recent Go and fix pypy download links * ci: fix typo in travis script, and adjust go to max appveyor version * ci: update appveyor PATH to pick up proper latest go version * fix: Re-enable test cleanup * ci: update appveyor to pin GOROOT * ci: update appveyor to use latest windows image
1 parent 8bcdf6b commit 7bd7360

File tree

10 files changed

+36
-18
lines changed

10 files changed

+36
-18
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# IDE files
2+
.idea/
3+
*.iml

.travis.yml

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
language: go
22

33
go:
4-
- 1.13.x
5-
- 1.12.x
6-
- 1.11.x
4+
- 1.16.x
5+
- 1.15.x
76
- master
87

98
cache:
@@ -31,8 +30,8 @@ before_install:
3130
# pypy3 isn't packaged in ubuntu yet.
3231
- TEMPDIR=$(mktemp -d)
3332
- export PYPYVERSION=v7.1.1
34-
- curl -L https://bitbucket.org/pypy/pypy/downloads/pypy2.7-${PYPYVERSION}-linux64.tar.bz2 --output $TEMPDIR/pypy2.tar.bz2
35-
- curl -L https://bitbucket.org/pypy/pypy/downloads/pypy3.6-${PYPYVERSION}-linux64.tar.bz2 --output $TEMPDIR/pypy3.tar.bz2
33+
- curl -L https://downloads.python.org/pypy/pypy2.7-${PYPYVERSION}-linux64.tar.bz2 --output $TEMPDIR/pypy2.tar.bz2
34+
- curl -L https://downloads.python.org/pypy/pypy3.6-${PYPYVERSION}-linux64.tar.bz2 --output $TEMPDIR/pypy3.tar.bz2
3635
- tar xf $TEMPDIR/pypy2.tar.bz2 -C $TEMPDIR
3736
- tar xf $TEMPDIR/pypy3.tar.bz2 -C $TEMPDIR
3837
- sudo ln -s $TEMPDIR/pypy2.7-$PYPYVERSION-linux64/bin/pypy /usr/local/bin/pypy

_examples/iface/iface.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func IfaceString(str interface{}) {
3636
cpkg.Printf("iface as string: %v\n", str)
3737
}
3838

39-
//gopy:interface=handle
39+
// gopy:interface=handle
4040
// this magic directive says, treat the interface arg as a handle
4141
func IfaceHandle(ifc interface{}) {
4242
cpkg.Printf("iface as handle: %v\n", ifc)

_examples/rename/rename.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
// package rename tests changing the names of methods and functions
66
package rename
77

8-
//gopy:name say_hi
8+
// gopy:name say_hi
99
func SayHi() string {
1010
return "hi"
1111
}
1212

1313
type MyStruct struct {
1414
}
1515

16-
//gopy:name say_something
16+
// gopy:name say_something
1717
func (s *MyStruct) SaySomething() (something string) {
1818
return "something"
1919
}

appveyor.yml

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
image: Previous Visual Studio 2019
2+
13
build: off
24

35
clone_folder: c:\gopath\src\github.com\go-python\gopy
@@ -11,15 +13,16 @@ branches:
1113
- master
1214

1315
environment:
14-
GOPATH: c:\gopath
16+
GOPATH: C:\gopath
17+
GOROOT: C:\go115
1518
GOPY_APPVEYOR_CI: '1'
1619
GOTRACEBACK: 'crash'
1720
#CPYTHON2DIR: "C:\\Python27-x64"
1821
CPYTHON3DIR: "C:\\Python37-x64"
1922
#PATH: '%GOPATH%\bin;%CPYTHON2DIR%;%CPYTHON2DIR%\\Scripts;%CPYTHON3DIR%;%CPYTHON3DIR%\\Scripts;C:\msys64\mingw64\bin;C:\msys64\usr\bin\;%PATH%'
20-
PATH: '%GOPATH%\bin;%CPYTHON3DIR%;%CPYTHON3DIR%\\Scripts;C:\msys64\mingw64\bin;C:\msys64\usr\bin\;%PATH%'
23+
PATH: '%GOPATH%\bin;%GOROOT%\bin;%CPYTHON3DIR%;%CPYTHON3DIR%\\Scripts;C:\msys64\mingw64\bin;C:\msys64\usr\bin\;%PATH%'
2124

22-
stack: go 1.13
25+
stack: go 1.15
2326

2427
build_script:
2528
- python --version
@@ -31,6 +34,8 @@ build_script:
3134
- "%CPYTHON3DIR%\\python -m pip install cffi"
3235
#- "%CPYTHON2DIR%\\python -m pip install pybindgen"
3336
- "%CPYTHON3DIR%\\python -m pip install pybindgen"
37+
- go version
38+
- go env
3439
- go get -v -t ./...
3540

3641
test_script:

bind/utils_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func TestPythonConfig(t *testing.T) {
7575

7676
for _, tc := range []struct {
7777
vm string
78-
want pyconfig
78+
want PyConfig
7979
}{
8080
{
8181
vm: "python2",

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ require (
66
github.com/gonuts/commander v0.1.0
77
github.com/gonuts/flag v0.1.0
88
github.com/pkg/errors v0.9.1
9-
golang.org/x/tools v0.0.0-20201123232213-4aa1a224cdb5
9+
golang.org/x/tools v0.1.0
1010
)

go.sum

+9-2
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,33 @@ github.com/gonuts/flag v0.1.0 h1:fqMv/MZ+oNGu0i9gp0/IQ/ZaPIDoAZBOBaJoV7viCWM=
44
github.com/gonuts/flag v0.1.0/go.mod h1:ZTmTGtrSPejTo/SRNhCqwLTmiAgyBdCkLYhHrAoBdz4=
55
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
66
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
7+
github.com/yuin/goldmark v1.2.1 h1:ruQGxdhGHe7FWOJPT0mKs5+pD2Xs1Bm/kdGlHO04FmM=
78
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
89
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
910
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
11+
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI=
1012
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
1113
golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4=
1214
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
1315
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
1416
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
17+
golang.org/x/net v0.0.0-20201021035429-f5854403a974 h1:IX6qOQeG5uLjB/hjjwjedwfjND0hgjPMMyO1RoIXQNI=
1518
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
1619
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
20+
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9 h1:SQFwaSi55rU7vdNs9Yr0Z324VNlrF+0wMqRXT4St8ck=
1721
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
1822
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
1923
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
2024
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
25+
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4 h1:myAQVi0cGEoqQVR5POX+8RR2mrocKqNN1hmeMqhX27k=
26+
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
2127
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
28+
golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k=
2229
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
2330
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
2431
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
25-
golang.org/x/tools v0.0.0-20201123232213-4aa1a224cdb5 h1:ylHD4UIwP+CofOZHT/selc5MjXJ3yZnEg2OfYkLaPXs=
26-
golang.org/x/tools v0.0.0-20201123232213-4aa1a224cdb5/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
32+
golang.org/x/tools v0.1.0 h1:po9/4sTYwZU9lPhi1tOrb4hCv3qrhiQ77LZfGa2OjwY=
33+
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
2734
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
2835
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
2936
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=

main_test.go

+5
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ var (
5252
testEnvironment = os.Environ()
5353
)
5454

55+
func init() {
56+
os.Setenv("GOFLAGS", "-mod=mod")
57+
testEnvironment = append(testEnvironment, "GOFLAGS=-mod=mod")
58+
}
59+
5560
func TestGovet(t *testing.T) {
5661
cmd := exec.Command("go", "vet", "./...")
5762
buf := new(bytes.Buffer)

version.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
package main
44

55
const (
6-
Version = "v0.3.4"
7-
GitCommit = "0d0bcab" // the commit JUST BEFORE the release
6+
Version = "v0.3.4"
7+
GitCommit = "0d0bcab" // the commit JUST BEFORE the release
88
VersionDate = "2020-11-24 02:36" // UTC
99
)
10-

0 commit comments

Comments
 (0)