Skip to content

Commit f96845d

Browse files
authored
Upgrade python version being used by the ci workflow. (#315)
* Upgrade python version being used by the ci workflow. * Update the python version in instance_vm.go. * Try to fix the v1 gomod test. * Add export python3 back. * Stop trying to find python2.7. * Seems like we still need to install python3. * There seems to be a mismatch between APPENGINE_DEV_APPSERVER_BINARY and APPENGINE_DEV_APPSERVER. * Apply the same change to v2 ci.
1 parent 93c9fa1 commit f96845d

File tree

4 files changed

+22
-12
lines changed

4 files changed

+22
-12
lines changed

.github/workflows/ci-v2.yaml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ jobs:
1717
working-directory: ./v2
1818

1919
steps:
20-
- name: Update base image and install Python2
20+
- name: Update base image, intall Python2 and Python3
2121
run: |
2222
sudo apt-get update
23-
sudo apt-get install -y python2
23+
sudo apt-get install -y python2
24+
sudo apt-get install -y python3
2425
- name: Set up Go
2526
uses: actions/setup-go@v2
2627
with:
@@ -51,6 +52,7 @@ jobs:
5152
working-directory: ${{env.working-directory}}
5253
run: |
5354
export APPENGINE_DEV_APPSERVER=$(which dev_appserver.py)
55+
export CLOUDSDK_PYTHON="python3"
5456
go test -v -cover -race google.golang.org/appengine/v2/...
5557
# TestAPICallAllocations doesn't run under race detector.
5658
go test -v -cover google.golang.org/appengine/v2/internal/... -run TestAPICallAllocations
@@ -64,12 +66,13 @@ jobs:
6466
go-version: [ '1.11.x', '1.12.x']
6567
env:
6668
working-directory: ./v2
67-
69+
6870
steps:
69-
- name: Update base image and intall Python2
71+
- name: Update base image, intall Python2 and Python3
7072
run: |
7173
sudo apt-get update
72-
sudo apt-get install -y python2
74+
sudo apt-get install -y python2
75+
sudo apt-get install -y python3
7376
- name: Set up Go
7477
uses: actions/setup-go@v2
7578
with:
@@ -99,6 +102,7 @@ jobs:
99102
working-directory: ${{env.working-directory}}
100103
run: |
101104
export APPENGINE_DEV_APPSERVER=$(which dev_appserver.py)
105+
export CLOUDSDK_PYTHON="python3"
102106
go test -v -cover -race google.golang.org/appengine/v2/...
103107
# TestAPICallAllocations doesn't run under race detector.
104108
go test -v -cover google.golang.org/appengine/v2/internal/... -run TestAPICallAllocations

.github/workflows/ci.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@ jobs:
1515
go-version: [ '1.11.x', '1.12.x', '1.13.x', '1.14.x', '1.15.x', '1.16.x', '1.18.x', '1.19.x', '1.20.x']
1616

1717
steps:
18-
- name: Update base image and intall Python2
18+
- name: Update base image, intall Python2 and Python3
1919
run: |
2020
sudo apt-get update
21-
sudo apt-get install -y python2
21+
sudo apt-get install -y python2
22+
sudo apt-get install -y python3
23+
export CLOUDSDK_PYTHON="python3"
2224
- name: Set up Go
2325
uses: actions/setup-go@v2
2426
with:
@@ -47,10 +49,11 @@ jobs:
4749
GO111MODULE: on
4850
run: |
4951
export APPENGINE_DEV_APPSERVER=$(which dev_appserver.py)
52+
export CLOUDSDK_PYTHON="python3"
5053
go test -v -cover -race google.golang.org/appengine/...
5154
# TestAPICallAllocations doesn't run under race detector.
5255
go test -v -cover google.golang.org/appengine/internal/... -run TestAPICallAllocations
53-
56+
5457
test-gopath:
5558
runs-on: ubuntu-latest
5659
strategy:
@@ -60,10 +63,12 @@ jobs:
6063
go-version: [ '1.11.x', '1.12.x']
6164

6265
steps:
63-
- name: Update base image and intall Python2
66+
- name: Update base image, intall Python2 and Python3
6467
run: |
6568
sudo apt-get update
66-
sudo apt-get install -y python2
69+
sudo apt-get install -y python2
70+
sudo apt-get install -y python3
71+
export CLOUDSDK_PYTHON="python3"
6772
- name: Set up Go
6873
uses: actions/setup-go@v2
6974
with:
@@ -91,6 +96,7 @@ jobs:
9196
- name: Test gopath
9297
run: |
9398
export APPENGINE_DEV_APPSERVER=$(which dev_appserver.py)
99+
export CLOUDSDK_PYTHON="python3"
94100
go test -v -cover -race google.golang.org/appengine/...
95101
# TestAPICallAllocations doesn't run under race detector.
96102
go test -v -cover google.golang.org/appengine/internal/... -run TestAPICallAllocations

aetest/instance_vm.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ func (i *instance) startChild() (err error) {
145145
return err
146146
}
147147
}
148-
executable := os.Getenv("APPENGINE_DEV_APPSERVER_BINARY")
148+
executable := os.Getenv("APPENGINE_DEV_APPSERVER")
149149
var appserverArgs []string
150150
if len(executable) == 0 {
151151
executable, err = findPython()

v2/aetest/instance.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ func fileExists(path string) bool {
167167
}
168168

169169
func findPython() (path string, err error) {
170-
for _, name := range []string{"python2.7", "python"} {
170+
for _, name := range []string{"python3"} {
171171
path, err = exec.LookPath(name)
172172
if err == nil {
173173
return

0 commit comments

Comments
 (0)