Upgrade our app to use python 3.10. (#2437)

* Hack that gets me running on cloudtop py3.10.

* Update other references 3.9 -> 3.10

* Update yaml runtime version

* Added TODO for cloud debugger
This commit is contained in:
Jason Robbins 2022-11-07 13:00:51 -08:00 коммит произвёл GitHub
Родитель eafa54913b
Коммит ffeb6b2daa
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
10 изменённых файлов: 22 добавлений и 18 удалений

Просмотреть файл

@ -55,7 +55,7 @@
// Use 'postCreateCommand' to run commands after the container is created.
// pip version https://github.com/microsoft/vscode-python/issues/18802
// Need to install pylint inside the virutalenv because the global one does not honor it.
"postCreateCommand": "python3.9 -m venv cs-env; . cs-env/bin/activate; python -m pip install pylint==2.13.4; npm run setup",
"postCreateCommand": "python3.10 -m venv cs-env; . cs-env/bin/activate; python -m pip install pylint==2.13.4; npm run setup",
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"

Просмотреть файл

@ -9,7 +9,7 @@ services:
# Update 'VARIANT' to pick a version of Python: 3, 3.10, 3.9, 3.8, 3.7, 3.6
# Append -bullseye or -buster to pin to an OS version.
# Use -bullseye variants on local arm64/Apple Silicon.
VARIANT: 3.9-bullseye
VARIANT: 3.10-bullseye
# Optional Node.js version to install
NODE_VERSION: "18"

2
.github/workflows/ci.yml поставляемый
Просмотреть файл

@ -18,7 +18,7 @@ jobs:
- name: set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
python-version: '3.10'
- name: pre-installation
run: |

2
.github/workflows/web_tests.yml поставляемый
Просмотреть файл

@ -27,7 +27,7 @@ jobs:
- name: set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
python-version: '3.10'
- name: pre-installation
run: |

Просмотреть файл

@ -1,6 +1,6 @@
# This GAE service contains most of the app, including all UI pages.
runtime: python39
runtime: python310
service: default
instance_class: F4_1G

Просмотреть файл

@ -1,6 +1,6 @@
# This GAE service contains most of the app, including all UI pages.
runtime: python39
runtime: python310
service: default
instance_class: F4_1G

Просмотреть файл

@ -1,4 +1,4 @@
runtime: python39
runtime: python310
service: notifier
handlers:

Просмотреть файл

@ -1,4 +1,4 @@
runtime: python39
runtime: python310
service: notifier
handlers:

Просмотреть файл

@ -8,11 +8,11 @@
"node": ">=18.0.0"
},
"scripts": {
"setup": "npm ci; python3.9 -m venv cs-env; npm run deps",
"setup": "npm ci; python3.10 -m venv cs-env; npm run deps",
"clean-setup": "rm -rf node_modules cs-env; npm run setup",
"deps": "source cs-env/bin/activate; pip install -r requirements.txt --upgrade; pip install -r requirements.dev.txt --upgrade",
"dev-deps": "echo 'dev-deps is no longer needed'",
"do-tests": "source cs-env/bin/activate; curl -X POST 'http://localhost:15606/reset' && python3 -m unittest discover -p '*_test.py' -b",
"do-tests": "source cs-env/bin/activate; curl -X POST 'http://localhost:15606/reset' && python3.10 -m unittest discover -p '*_test.py' -b",
"start-emulator-persist": "gcloud beta emulators datastore start --host-port=:15606 --consistency=1.0",
"start-emulator": "gcloud beta emulators datastore start --host-port=:15606 --no-store-on-disk --consistency=1.0",
"stop-emulator": "curl -X POST 'http://localhost:15606/shutdown'",
@ -20,13 +20,13 @@
"watch": "gulp watch",
"start-app": "npm run build && curl --retry 4 http://localhost:15606/ --retry-connrefused && ./scripts/start_server.sh",
"start": "source cs-env/bin/activate; (npm run start-emulator-persist > /dev/null 2>&1 &); npm run start-app; status=$?; npm run stop-emulator; exit $status",
"stop": "killall cs-env/bin/python3.9",
"stop": "killall cs-env/bin/python3.10",
"test": "(npm run start-emulator > /dev/null 2>&1 &); sleep 6; curl --retry 4 http://localhost:15606/ --retry-connrefused; npm run do-tests; status=$?; npm run stop-emulator; exit $status",
"webtest": "web-test-runner \"client-src/**/*_test.js\" --node-resolve --playwright --browsers chromium firefox",
"webtest-coverage": "web-test-runner \"client-src/**/*_test.js\" --node-resolve --playwright --coverage --browsers chromium firefox",
"do-coverage": "coverage3 erase && coverage3 run -m unittest discover -p '*_test.py' -b && coverage3 html",
"coverage": "source cs-env/bin/activate; (npm run start-emulator > /dev/null 2>&1 &); sleep 3; curl --retry 4 http://localhost:15606/ --retry-connrefused; npm run do-coverage; npm run stop-emulator",
"view-coverage": "pushd htmlcov/; python3 -m http.server 8080; popd",
"view-coverage": "pushd htmlcov/; python3.10 -m http.server 8080; popd",
"mypy": "source cs-env/bin/activate; mypy --ignore-missing-imports --exclude cs-env/ --exclude appengine_config.py .",
"lint": "gulp lint-fix && lit-analyzer \"client-src/elements/chromedash-!(featurelist)*.js\"",
"presubmit": "npm test && npm run webtest && npm run lint && npm run mypy",

Просмотреть файл

@ -6,7 +6,11 @@ appengine-python-standard>=1.0.0
html5lib==1.1
funcsigs==1.0.2
google-api-python-client==2.47.0
google-python-cloud-debugger==2.18
# TODO(jrobbins): Add this back or replace it when python 3.10 is supported.
# google-python-cloud-debugger==2.18
# See https://github.com/GoogleCloudPlatform/cloud-debug-python/issues/33
google-cloud-tasks==2.7.0
google-cloud-ndb==1.11.1
google-cloud-logging==3.0.0