Skip to content

Commit

Permalink
switch Circle from Python 3.7 to 3.9
Browse files Browse the repository at this point in the history
...by migrating from the google/cloud-sdk Docker image to cimg/python
  • Loading branch information
snarfed committed Oct 8, 2022
1 parent e95f6aa commit be1f4bc
Showing 1 changed file with 24 additions and 18 deletions.
42 changes: 24 additions & 18 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,58 @@
# CircleCI automatically reads this file from our repo and uses it for
# configuration. Docs:
# https://circleci.com/docs/2.0/configuration-reference/
# https://circleci.com/docs/2.0/sample-config/
version: 2
# https://circleci.com/docs/2.1/configuration-reference/
# https://circleci.com/docs/2.1/sample-config/
version: 2.1

jobs:
build:
docker:
# https://circleci.com/docs/2.0/google-auth/#installing-the-google-cloud-sdk
- image: google/cloud-sdk
- image: cimg/python:3.9

environment:
# https://github.com/GoogleCloudPlatform/google-cloud-datastore/issues/168#issuecomment-294418422
- APPLICATION_ID: dev~bridgy-federated
# - APPLICATION_ID: dev~bridgy-federated

steps:
- checkout

- restore_cache:
key: venv-2-{{ .Branch }}-{{ checksum "requirements.txt" }}
key: venv-3-{{ .Branch }}-{{ checksum "requirements.txt" }}

- run:
name: Dependencies
name: Base dependencies
command: |
# google-cloud-sdk: https://cloud.google.com/sdk/docs/install#deb
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -
sudo apt-get update
sudo apt-get install -y apt-transport-https ca-certificates gnupg google-cloud-sdk google-cloud-sdk-datastore-emulator default-jre
- run:
name: Python dependencies
command: |
apt-get update
apt-get install -y python3.7 python3.7-venv python3.7-dev
python3.7 -m venv local3
. local3/bin/activate
pip install -U pip
pip install cython # avoids grpcio install bug (search _needs_stub)
pip -V
# make sure we install these at head, below
pip uninstall -y granary oauth-dropins
pip install -U -r requirements.txt
pip install mox3
pip install coverage coveralls
- run:
name: Build and test
command: |
. local3/bin/activate
CLOUDSDK_CORE_PROJECT=bridgy-federated gcloud beta emulators datastore start --no-store-on-disk --consistency=1.0 --host-port=localhost:8089 < /dev/null >& /dev/null &
sleep 5s
python -m coverage run --source=. --omit=appengine_config.py,local3/\*,logs.py,tests/\* -m unittest discover -v
python -m coverage run --source=. --omit=appengine_config.py,logs.py,tests/\* -m unittest discover -v
python -m coverage html -d /tmp/coverage_html
if [ "$COVERALLS_REPO_TOKEN" != "" ]; then coveralls || true; fi
- save_cache:
key: venv-2-{{ .Branch }}-{{ checksum "requirements.txt" }}
key: venv-3-{{ .Branch }}-{{ checksum "requirements.txt" }}
paths:
- local
- /home/circleci/.pyenv
- /usr/lib/google-cloud-sdk
- /usr/lib/jvm/java-11-openjdk-amd64

- store_artifacts:
path: /tmp/coverage_html

0 comments on commit be1f4bc

Please sign in to comment.