Skip to content

Commit 3b3e9b5

Browse files
committed
all: remove tests for python2
Signed-off-by: Sebastien Binet <[email protected]>
1 parent d342bb8 commit 3b3e9b5

File tree

6 files changed

+56
-80
lines changed

6 files changed

+56
-80
lines changed

.github/workflows/ci.yml

+1-10
Original file line numberDiff line numberDiff line change
@@ -52,26 +52,17 @@ jobs:
5252
if: matrix.platform == 'ubuntu-latest'
5353
run: |
5454
sudo apt-get update
55-
sudo apt-get install curl libffi-dev python-cffi python3-cffi python3-pip
55+
sudo apt-get install curl libffi-dev python3-cffi python3-pip
5656
# pypy3 isn't packaged in ubuntu yet.
5757
TEMPDIR=$(mktemp -d)
58-
curl -L https://downloads.python.org/pypy/pypy2.7-${PYPYVERSION}-linux64.tar.bz2 --output $TEMPDIR/pypy2.tar.bz2
5958
curl -L https://downloads.python.org/pypy/pypy3.6-${PYPYVERSION}-linux64.tar.bz2 --output $TEMPDIR/pypy3.tar.bz2
60-
tar xf $TEMPDIR/pypy2.tar.bz2 -C $TEMPDIR
6159
tar xf $TEMPDIR/pypy3.tar.bz2 -C $TEMPDIR
62-
sudo ln -s $TEMPDIR/pypy2.7-$PYPYVERSION-linux64/bin/pypy /usr/local/bin/pypy
6360
sudo ln -s $TEMPDIR/pypy3.6-$PYPYVERSION-linux64/bin/pypy3 /usr/local/bin/pypy3
64-
# install pip (for pypy, python2)
65-
curl -L https://bootstrap.pypa.io/pip/2.7/get-pip.py --output ${TEMPDIR}/get-pip2.py
66-
python2 ${TEMPDIR}/get-pip2.py
6761
# curl -L https://bootstrap.pypa.io/get-pip.py --output ${TEMPDIR}/get-pip.py
68-
# pypy ${TEMPDIR}/get-pip.py
6962
# pypy3 ${TEMPDIR}/get-pip.py
7063
7164
# install pybindgen
72-
python2 -m pip install --user -U pybindgen
7365
python3 -m pip install --user -U pybindgen
74-
# pypy -m pip install --user -U pybindgen
7566
# pypy3 -m pip install --user -U pybindgen
7667
7768
# install goimports

SUPPORT_MATRIX.md

+28-28
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,31 @@
33
NOTE: File auto-generated by TestCheckSupportMatrix in main_test.go. Please
44
don't modify manually.
55

6-
Feature |py2 | py3
7-
--- | --- | ---
8-
_examples/arrays | yes | yes
9-
_examples/cgo | yes | yes
10-
_examples/consts | yes | yes
11-
_examples/cstrings | yes | yes
12-
_examples/empty | yes | yes
13-
_examples/funcs | yes | yes
14-
_examples/gopygc | yes | yes
15-
_examples/gostrings | yes | yes
16-
_examples/hi | no | yes
17-
_examples/iface | no | yes
18-
_examples/lot | yes | yes
19-
_examples/maps | yes | yes
20-
_examples/named | yes | yes
21-
_examples/osfile | yes | yes
22-
_examples/pkgconflict | yes | yes
23-
_examples/pointers | yes | yes
24-
_examples/pyerrors | yes | yes
25-
_examples/rename | yes | yes
26-
_examples/seqs | yes | yes
27-
_examples/simple | yes | yes
28-
_examples/sliceptr | yes | yes
29-
_examples/slices | yes | yes
30-
_examples/structs | yes | yes
31-
_examples/unicode | no | yes
32-
_examples/variadic | no | yes
33-
_examples/vars | yes | yes
6+
Feature |py3
7+
--- | ---
8+
_examples/arrays | yes
9+
_examples/cgo | yes
10+
_examples/consts | yes
11+
_examples/cstrings | yes
12+
_examples/empty | yes
13+
_examples/funcs | yes
14+
_examples/gopygc | yes
15+
_examples/gostrings | yes
16+
_examples/hi | yes
17+
_examples/iface | yes
18+
_examples/lot | yes
19+
_examples/maps | yes
20+
_examples/named | yes
21+
_examples/osfile | yes
22+
_examples/pkgconflict | yes
23+
_examples/pointers | yes
24+
_examples/pyerrors | yes
25+
_examples/rename | yes
26+
_examples/seqs | yes
27+
_examples/simple | yes
28+
_examples/sliceptr | yes
29+
_examples/slices | yes
30+
_examples/structs | yes
31+
_examples/unicode | yes
32+
_examples/variadic | yes
33+
_examples/vars | yes

appveyor.yml

+2-6
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,21 @@ branches:
1414

1515
environment:
1616
GOPATH: C:\gopath
17-
GOROOT: C:\go115
17+
GOROOT: C:\go119
1818
GOPY_APPVEYOR_CI: '1'
1919
GOTRACEBACK: 'crash'
2020
#CPYTHON2DIR: "C:\\Python27-x64"
2121
CPYTHON3DIR: "C:\\Python37-x64"
2222
#PATH: '%GOPATH%\bin;%CPYTHON2DIR%;%CPYTHON2DIR%\\Scripts;%CPYTHON3DIR%;%CPYTHON3DIR%\\Scripts;C:\msys64\mingw64\bin;C:\msys64\usr\bin\;%PATH%'
2323
PATH: '%GOPATH%\bin;%GOROOT%\bin;%CPYTHON3DIR%;%CPYTHON3DIR%\\Scripts;C:\msys64\mingw64\bin;C:\msys64\usr\bin\;%PATH%'
2424

25-
stack: go 1.15
25+
stack: go 1.19
2626

2727
build_script:
2828
- python --version
29-
#- "%CPYTHON2DIR%\\python --version"
3029
- "%CPYTHON3DIR%\\python --version"
31-
#- "%CPYTHON2DIR%\\python -m pip install --upgrade pip"
3230
- "%CPYTHON3DIR%\\python -m pip install --upgrade pip"
33-
#- "%CPYTHON2DIR%\\python -m pip install cffi"
3431
- "%CPYTHON3DIR%\\python -m pip install cffi"
35-
#- "%CPYTHON2DIR%\\python -m pip install pybindgen"
3632
- "%CPYTHON3DIR%\\python -m pip install pybindgen"
3733
- go version
3834
- go env

main_test.go

+25-32
Original file line numberDiff line numberDiff line change
@@ -23,31 +23,31 @@ import (
2323
var (
2424
testBackends = map[string]string{}
2525
features = map[string][]string{
26-
"_examples/hi": []string{"py3"}, // output is different for 2 vs. 3 -- only checking 3 output
27-
"_examples/funcs": []string{"py2", "py3"},
28-
"_examples/sliceptr": []string{"py2", "py3"},
29-
"_examples/simple": []string{"py2", "py3"},
30-
"_examples/empty": []string{"py2", "py3"},
31-
"_examples/named": []string{"py2", "py3"},
32-
"_examples/structs": []string{"py2", "py3"},
33-
"_examples/consts": []string{"py2", "py3"}, // 2 doesn't report .666 decimals
34-
"_examples/vars": []string{"py2", "py3"},
35-
"_examples/seqs": []string{"py2", "py3"},
36-
"_examples/cgo": []string{"py2", "py3"},
37-
"_examples/pyerrors": []string{"py2", "py3"},
38-
"_examples/iface": []string{"py3"}, // output order diff for 2, fails but actually works
39-
"_examples/pointers": []string{"py2", "py3"},
40-
"_examples/arrays": []string{"py2", "py3"},
41-
"_examples/slices": []string{"py2", "py3"},
42-
"_examples/maps": []string{"py2", "py3"},
43-
"_examples/gostrings": []string{"py2", "py3"},
44-
"_examples/rename": []string{"py2", "py3"},
45-
"_examples/lot": []string{"py2", "py3"},
46-
"_examples/unicode": []string{"py3"}, // doesn't work for 2
47-
"_examples/osfile": []string{"py2", "py3"},
48-
"_examples/gopygc": []string{"py2", "py3"},
49-
"_examples/cstrings": []string{"py2", "py3"},
50-
"_examples/pkgconflict": []string{"py2", "py3"},
26+
"_examples/hi": []string{"py3"},
27+
"_examples/funcs": []string{"py3"},
28+
"_examples/sliceptr": []string{"py3"},
29+
"_examples/simple": []string{"py3"},
30+
"_examples/empty": []string{"py3"},
31+
"_examples/named": []string{"py3"},
32+
"_examples/structs": []string{"py3"},
33+
"_examples/consts": []string{"py3"},
34+
"_examples/vars": []string{"py3"},
35+
"_examples/seqs": []string{"py3"},
36+
"_examples/cgo": []string{"py3"},
37+
"_examples/pyerrors": []string{"py3"},
38+
"_examples/iface": []string{"py3"},
39+
"_examples/pointers": []string{"py3"},
40+
"_examples/arrays": []string{"py3"},
41+
"_examples/slices": []string{"py3"},
42+
"_examples/maps": []string{"py3"},
43+
"_examples/gostrings": []string{"py3"},
44+
"_examples/rename": []string{"py3"},
45+
"_examples/lot": []string{"py3"},
46+
"_examples/unicode": []string{"py3"},
47+
"_examples/osfile": []string{"py3"},
48+
"_examples/gopygc": []string{"py3"},
49+
"_examples/cstrings": []string{"py3"},
50+
"_examples/pkgconflict": []string{"py3"},
5151
"_examples/variadic": []string{"py3"},
5252
}
5353

@@ -130,7 +130,6 @@ ignoring python incompatible function: .func github.com/go-python/gopy/_examples
130130
func TestHi(t *testing.T) {
131131
// t.Parallel()
132132
path := "_examples/hi"
133-
// NOTE: output differs for python2 -- only valid checking for 3
134133
testPkg(t, pkg{
135134
path: path,
136135
lang: features[path],
@@ -923,7 +922,6 @@ type pkg struct {
923922
}
924923

925924
func testPkg(t *testing.T, table pkg) {
926-
// backends := []string{"py2", "py3"}
927925
backends := []string{"py3"}
928926
// backends := table.lang // todo: enabling py2 testing requires separate "want" output
929927
for _, be := range backends {
@@ -935,11 +933,6 @@ func testPkg(t *testing.T, table pkg) {
935933
continue
936934
}
937935
switch be {
938-
case "py2":
939-
t.Run(be, func(t *testing.T) {
940-
// t.Parallel()
941-
testPkgBackend(t, vm, table)
942-
})
943936
case "py3":
944937
t.Run(be, func(t *testing.T) {
945938
// t.Parallel()

main_unix_test.go

-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ func init() {
1919
testEnvironment = os.Environ()
2020

2121
var (
22-
py2 = "python2"
2322
py3 = "python3"
24-
// pypy2 = "pypy"
2523
// pypy3 = "pypy3"
2624
)
2725

@@ -40,7 +38,6 @@ func init() {
4038
mandatory bool
4139
}{
4240
{"py3", py3, "", true},
43-
{"py2", py2, "", true},
4441
} {
4542
args := []string{"-c", ""}
4643
if be.module != "" {

main_windows_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ func init() {
4040
mandatory bool
4141
}{
4242
{"py3", py3, "", true},
43-
// {"py2", py2, "", true},
4443
} {
4544
args := []string{"-c", ""}
4645
if be.module != "" {

0 commit comments

Comments
 (0)