Skip to content

Commit c44c63c

Browse files
authored
chore: add test support for Python 3.9 (#682)
Adds nox and CI targets for 3.9
1 parent 29d7e7c commit c44c63c

File tree

2 files changed

+94
-4
lines changed

2 files changed

+94
-4
lines changed

packages/gapic-generator/.circleci/config.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ workflows:
2020
filters:
2121
tags:
2222
only: /^v\d+\.\d+\.\d+$/
23+
- unit-3.9:
24+
filters:
25+
tags:
26+
only: /^v\d+\.\d+\.\d+$/
2327
- showcase-unit-3.6:
2428
requires:
2529
- unit-3.6
@@ -38,6 +42,12 @@ workflows:
3842
filters:
3943
tags:
4044
only: /^v\d+\.\d+\.\d+$/
45+
- showcase-unit-3.9:
46+
requires:
47+
- unit-3.9
48+
filters:
49+
tags:
50+
only: /^v\d+\.\d+\.\d+$/
4151
- showcase-unit-alternative-templates-3.7:
4252
requires:
4353
- unit-3.7
@@ -50,6 +60,12 @@ workflows:
5060
filters:
5161
tags:
5262
only: /^v\d+\.\d+\.\d+$/
63+
- showcase-unit-alternative-templates-3.9:
64+
requires:
65+
- unit-3.9
66+
filters:
67+
tags:
68+
only: /^v\d+\.\d+\.\d+$/
5369
- showcase-unit-add-iam-methods:
5470
requires:
5571
- unit-3.8
@@ -75,6 +91,7 @@ workflows:
7591
- showcase-unit-3.6
7692
- showcase-unit-3.7
7793
- showcase-unit-3.8
94+
- showcase-unit-3.9
7895
- showcase-mypy
7996
filters:
8097
tags:
@@ -86,6 +103,7 @@ workflows:
86103
- showcase-unit-3.6
87104
- showcase-unit-3.7
88105
- showcase-unit-3.8
106+
- showcase-unit-3.9
89107
- showcase-mypy
90108
filters:
91109
tags:
@@ -96,6 +114,7 @@ workflows:
96114
- mypy
97115
- showcase-unit-alternative-templates-3.7
98116
- showcase-unit-alternative-templates-3.8
117+
- showcase-unit-alternative-templates-3.9
99118
- showcase-mypy-alternative-templates
100119
filters:
101120
tags:
@@ -106,6 +125,7 @@ workflows:
106125
- mypy
107126
- showcase-unit-alternative-templates-3.7
108127
- showcase-unit-alternative-templates-3.8
128+
- showcase-unit-alternative-templates-3.9
109129
- showcase-mypy-alternative-templates
110130
filters:
111131
tags:
@@ -416,6 +436,30 @@ jobs:
416436
- run:
417437
name: Run unit tests.
418438
command: nox -s showcase_unit-3.8
439+
showcase-unit-3.9:
440+
docker:
441+
- image: python:3.9-slim
442+
steps:
443+
- checkout
444+
- run:
445+
name: Install system dependencies.
446+
command: |
447+
apt-get update
448+
apt-get install -y curl pandoc unzip gcc
449+
- run:
450+
name: Install protoc 3.12.1.
451+
command: |
452+
mkdir -p /usr/src/protoc/
453+
curl --location https://github.com/google/protobuf/releases/download/v3.12.1/protoc-3.12.1-linux-x86_64.zip --output /usr/src/protoc/protoc-3.12.1.zip
454+
cd /usr/src/protoc/
455+
unzip protoc-3.12.1.zip
456+
ln -s /usr/src/protoc/bin/protoc /usr/local/bin/protoc
457+
- run:
458+
name: Install nox.
459+
command: pip install nox
460+
- run:
461+
name: Run unit tests.
462+
command: nox -s showcase_unit-3.9
419463
showcase-unit-alternative-templates-3.7:
420464
docker:
421465
- image: python:3.7-slim
@@ -464,6 +508,30 @@ jobs:
464508
- run:
465509
name: Run unit tests.
466510
command: nox -s showcase_unit_alternative_templates-3.8
511+
showcase-unit-alternative-templates-3.9:
512+
docker:
513+
- image: python:3.9-slim
514+
steps:
515+
- checkout
516+
- run:
517+
name: Install system dependencies.
518+
command: |
519+
apt-get update
520+
apt-get install -y curl pandoc unzip gcc
521+
- run:
522+
name: Install protoc 3.12.1.
523+
command: |
524+
mkdir -p /usr/src/protoc/
525+
curl --location https://github.com/google/protobuf/releases/download/v3.12.1/protoc-3.12.1-linux-x86_64.zip --output /usr/src/protoc/protoc-3.12.1.zip
526+
cd /usr/src/protoc/
527+
unzip protoc-3.12.1.zip
528+
ln -s /usr/src/protoc/bin/protoc /usr/local/bin/protoc
529+
- run:
530+
name: Install nox.
531+
command: pip install nox
532+
- run:
533+
name: Run unit tests.
534+
command: nox -s showcase_unit_alternative_templates-3.9
467535
showcase-unit-add-iam-methods:
468536
docker:
469537
- image: python:3.8-slim
@@ -602,6 +670,28 @@ jobs:
602670
name: Submit coverage data to codecov.
603671
command: codecov
604672
when: always
673+
unit-3.9:
674+
docker:
675+
- image: python:3.9-slim
676+
steps:
677+
- checkout
678+
- run:
679+
name: Install pandoc
680+
command: |
681+
apt-get update
682+
apt-get install -y pandoc gcc git
683+
- run:
684+
name: Install nox and codecov.
685+
command: |
686+
pip install nox
687+
pip install codecov
688+
- run:
689+
name: Run unit tests.
690+
command: nox -s unit-3.9
691+
- run:
692+
name: Submit coverage data to codecov.
693+
command: codecov
694+
when: always
605695
style-check:
606696
docker:
607697
- image: python:3.6-alpine

packages/gapic-generator/noxfile.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
ADS_TEMPLATES = path.join(path.dirname(__file__), "gapic", "ads-templates")
2727

2828

29-
@nox.session(python=["3.6", "3.7", "3.8"])
29+
@nox.session(python=["3.6", "3.7", "3.8", "3.9"])
3030
def unit(session):
3131
"""Run the unit test suite."""
3232

@@ -169,7 +169,7 @@ def showcase_mtls_alternative_templates(session):
169169
)
170170

171171

172-
@nox.session(python=["3.6", "3.7", "3.8"])
172+
@nox.session(python=["3.6", "3.7", "3.8", "3.9"])
173173
def showcase_unit(
174174
session, templates="DEFAULT", other_opts: typing.Iterable[str] = (),
175175
):
@@ -198,7 +198,7 @@ def showcase_unit(
198198
)
199199

200200

201-
@nox.session(python=["3.7", "3.8"])
201+
@nox.session(python=["3.7", "3.8", "3.9"])
202202
def showcase_unit_alternative_templates(session):
203203
showcase_unit(session, templates=ADS_TEMPLATES, other_opts=("old-naming",))
204204

@@ -250,7 +250,7 @@ def docs(session):
250250
)
251251

252252

253-
@nox.session(python=["3.7", "3.8"])
253+
@nox.session(python=["3.7", "3.8", "3.9"])
254254
def mypy(session):
255255
"""Perform typecheck analysis."""
256256

0 commit comments

Comments
 (0)