Skip to content

Commit 4a6a53e

Browse files
authored
chore: add tests for python 3.10 (googleapis#1020)
1 parent 911cc63 commit 4a6a53e

File tree

14 files changed

+99
-44
lines changed

14 files changed

+99
-44
lines changed

.github/workflows/tests.yaml

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@ concurrency:
1515

1616
jobs:
1717
docs:
18+
# Don't upgrade python version; there's a bug in 3.10 sphinx
1819
runs-on: ubuntu-latest
1920
steps:
2021
- uses: actions/checkout@v2
21-
- name: Set up Python 3.9
22+
- name: Set up Python
2223
uses: actions/setup-python@v2
2324
with:
24-
python-version: 3.9
25+
python-version: "3.9"
2526
cache: 'pip'
2627
- name: Install nox.
2728
run: python -m pip install nox
@@ -31,10 +32,10 @@ jobs:
3132
runs-on: ubuntu-latest
3233
steps:
3334
- uses: actions/checkout@v2
34-
- name: Set up Python 3.9
35+
- name: Set up Python "3.10"
3536
uses: actions/setup-python@v2
3637
with:
37-
python-version: 3.9
38+
python-version: "3.10"
3839
cache: 'pip'
3940
- name: Install nox.
4041
run: python -m pip install nox
@@ -47,10 +48,10 @@ jobs:
4748
runs-on: ubuntu-latest
4849
steps:
4950
- uses: actions/checkout@v2
50-
- name: Set up Python 3.9
51+
- name: Set up Python "3.10"
5152
uses: actions/setup-python@v2
5253
with:
53-
python-version: 3.9
54+
python-version: "3.10"
5455
cache: 'pip'
5556
- name: Install system dependencies.
5657
run: |
@@ -66,7 +67,7 @@ jobs:
6667
./gapic-showcase run &
6768
cd -
6869
env:
69-
SHOWCASE_VERSION: 0.18.0
70+
SHOWCASE_VERSION: 0.19.0
7071
- name: Install nox.
7172
run: python -m pip install nox
7273
- name: Install protoc 3.12.1.
@@ -91,10 +92,10 @@ jobs:
9192
run: |
9293
sudo mkdir -p /tmp/workspace/tests/cert/
9394
sudo chown -R ${USER} /tmp/workspace/
94-
- name: Set up Python 3.9
95+
- name: Set up Python "3.10"
9596
uses: actions/setup-python@v2
9697
with:
97-
python-version: 3.9
98+
python-version: "3.10"
9899
cache: 'pip'
99100
- name: Copy mtls files
100101
run: cp tests/cert/mtls.* /tmp/workspace/tests/cert/
@@ -133,23 +134,23 @@ jobs:
133134
cd ..
134135
nox -s ${{ matrix.target }}
135136
env:
136-
SHOWCASE_VERSION: 0.18.0
137+
SHOWCASE_VERSION: 0.19.0
137138
# TODO(yon-mg): add compute unit tests
138139
showcase-unit:
139140
strategy:
140141
matrix:
141-
python: [3.6, 3.7, 3.8, 3.9]
142+
python: ["3.6", "3.7", "3.8", "3.9", "3.10"]
142143
variant: ['', _alternative_templates]
143144
exclude:
144-
- python: 3.6
145+
- python: "3.6"
145146
variant: _alternative_templates
146147
runs-on: ubuntu-latest
147148
steps:
148149
- uses: actions/checkout@v2
149-
- name: Set up Python ${{ matrix.python }}
150+
- name: Set up Python "${{ matrix.python }}"
150151
uses: actions/setup-python@v2
151152
with:
152-
python-version: ${{ matrix.python }}
153+
python-version: "${{ matrix.python }}"
153154
cache: 'pip'
154155
- name: Install system dependencies.
155156
run: |
@@ -168,15 +169,15 @@ jobs:
168169
- name: Run unit tests.
169170
run: nox -s showcase_unit${{ matrix.variant }}-${{ matrix.python }}
170171
env:
171-
SHOWCASE_VERSION: 0.18.0
172+
SHOWCASE_VERSION: 0.19.0
172173
showcase-unit-add-iam-methods:
173174
runs-on: ubuntu-latest
174175
steps:
175176
- uses: actions/checkout@v2
176-
- name: Set up Python 3.9
177+
- name: Set up Python "3.10"
177178
uses: actions/setup-python@v2
178179
with:
179-
python-version: 3.9
180+
python-version: "3.10"
180181
cache: 'pip'
181182
- name: Install system dependencies.
182183
run: |
@@ -195,18 +196,18 @@ jobs:
195196
- name: Run unit tests.
196197
run: nox -s showcase_unit_add_iam_methods
197198
env:
198-
SHOWCASE_VERSION: 0.18.0
199+
SHOWCASE_VERSION: 0.19.0
199200
showcase-mypy:
200201
runs-on: ubuntu-latest
201202
strategy:
202203
matrix:
203204
variant: ['', _alternative_templates]
204205
steps:
205206
- uses: actions/checkout@v2
206-
- name: Set up Python 3.9
207+
- name: Set up Python "3.10"
207208
uses: actions/setup-python@v2
208209
with:
209-
python-version: 3.9
210+
python-version: "3.10"
210211
cache: 'pip'
211212
- name: Install system dependencies.
212213
run: |
@@ -225,15 +226,15 @@ jobs:
225226
- name: Typecheck the generated output.
226227
run: nox -s showcase_mypy${{ matrix.variant }}
227228
env:
228-
SHOWCASE_VERSION: 0.18.0
229+
SHOWCASE_VERSION: 0.19.0
229230
snippetgen:
230231
runs-on: ubuntu-latest
231232
steps:
232233
- uses: actions/checkout@v2
233-
- name: Set up Python 3.9
234+
- name: Set up Python "3.10"
234235
uses: actions/setup-python@v2
235236
with:
236-
python-version: 3.9
237+
python-version: "3.10"
237238
cache: 'pip'
238239
- name: Install system dependencies.
239240
run: |
@@ -246,7 +247,7 @@ jobs:
246247
unit:
247248
strategy:
248249
matrix:
249-
python: [3.6, 3.7, 3.8, 3.9]
250+
python: ["3.6", "3.7", "3.8", "3.9", "3.10"]
250251
runs-on: ubuntu-latest
251252
steps:
252253
- uses: actions/checkout@v2
@@ -267,10 +268,10 @@ jobs:
267268
fragment:
268269
strategy:
269270
matrix:
270-
python: [3.6, 3.7, 3.8, 3.9]
271+
python: ["3.6", "3.7", "3.8", "3.9", "3.10"]
271272
variant: ['', _alternative_templates]
272273
exclude:
273-
- python: 3.6
274+
- python: "3.6"
274275
variant: _alternative_templates
275276
runs-on: ubuntu-latest
276277
steps:
@@ -321,10 +322,10 @@ jobs:
321322
runs-on: ubuntu-latest
322323
steps:
323324
- uses: actions/checkout@v2
324-
- name: Set up Python 3.9
325+
- name: Set up Python 3.10
325326
uses: actions/setup-python@v2
326327
with:
327-
python-version: 3.9
328+
python-version: "3.10"
328329
cache: 'pip'
329330
- name: Install nox.
330331
run: |
@@ -339,10 +340,10 @@ jobs:
339340
runs-on: ubuntu-latest
340341
steps:
341342
- uses: actions/checkout@v2
342-
- name: Set up Python 3.9
343+
- name: Set up Python "3.10"
343344
uses: actions/setup-python@v2
344345
with:
345-
python-version: 3.9
346+
python-version: "3.10"
346347
cache: 'pip'
347348
- name: Install autopep8
348349
run: |

gapic/ads-templates/noxfile.py.j2

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,14 @@ import os
77
import nox # type: ignore
88

99

10-
@nox.session(python=['3.7', '3.8', '3.9'])
10+
ALL_PYTHON = [
11+
"3.7",
12+
"3.8",
13+
"3.9",
14+
"3.10",
15+
]
16+
17+
@nox.session(python=ALL_PYTHON)
1118
def unit(session):
1219
"""Run the unit test suite."""
1320

@@ -25,7 +32,7 @@ def unit(session):
2532
)
2633

2734

28-
@nox.session(python=['3.7', '3.8', '3.9'])
35+
@nox.session(python=ALL_PYTHON)
2936
def mypy(session):
3037
"""Run the type checker."""
3138
session.install('mypy')

gapic/ads-templates/setup.py.j2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ setuptools.setup(
4444
'Programming Language :: Python :: 3.7',
4545
'Programming Language :: Python :: 3.8',
4646
'Programming Language :: Python :: 3.9',
47+
'Programming Language :: Python :: 3.10',
4748
'Topic :: Internet',
4849
'Topic :: Software Development :: Libraries :: Python Modules',
4950
],

gapic/templates/noxfile.py.j2

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ import sys
1111

1212
import nox # type: ignore
1313

14+
ALL_PYTHON = [
15+
"3.6",
16+
"3.7",
17+
"3.8",
18+
"3.9",
19+
"3.10",
20+
]
21+
1422
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
1523

1624
LOWER_BOUND_CONSTRAINTS_FILE = CURRENT_DIRECTORY / "constraints.txt"
@@ -32,7 +40,7 @@ nox.sessions = [
3240
"lint_setup_py",
3341
]
3442

35-
@nox.session(python=['3.6', '3.7', '3.8', '3.9', '3.10'])
43+
@nox.session(python=ALL_PYTHON)
3644
def unit(session):
3745
"""Run the unit test suite."""
3846

@@ -62,7 +70,7 @@ def cover(session):
6270
session.run("coverage", "erase")
6371

6472

65-
@nox.session(python=['3.6', '3.7', '3.8', '3.9'])
73+
@nox.session(python=ALL_PYTHON)
6674
def mypy(session):
6775
"""Run the type checker."""
6876
session.install('mypy', 'types-pkg_resources')

gapic/templates/setup.py.j2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ setuptools.setup(
5151
'Programming Language :: Python :: 3.7',
5252
'Programming Language :: Python :: 3.8',
5353
'Programming Language :: Python :: 3.9',
54+
'Programming Language :: Python :: 3.10',
5455
'Topic :: Internet',
5556
'Topic :: Software Development :: Libraries :: Python Modules',
5657
],

noxfile.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
nox.options.error_on_missing_interpreters = True
3030

3131

32-
showcase_version = os.environ.get("SHOWCASE_VERSION", "0.18.0")
32+
showcase_version = os.environ.get("SHOWCASE_VERSION", "0.19.0")
3333
ADS_TEMPLATES = path.join(path.dirname(__file__), "gapic", "ads-templates")
3434

3535

@@ -38,6 +38,7 @@
3838
"3.7",
3939
"3.8",
4040
"3.9",
41+
"3.10",
4142
)
4243

4344
NEWEST_PYTHON = ALL_PYTHON[-1]
@@ -393,7 +394,7 @@ def snippetgen(session):
393394
session.run("py.test", "-vv", "tests/snippetgen")
394395

395396

396-
@nox.session(python=NEWEST_PYTHON)
397+
@nox.session(python="3.9")
397398
def docs(session):
398399
"""Build the docs."""
399400

tests/integration/goldens/asset/noxfile.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@
2222

2323
import nox # type: ignore
2424

25+
ALL_PYTHON = [
26+
"3.6",
27+
"3.7",
28+
"3.8",
29+
"3.9",
30+
"3.10",
31+
]
32+
2533
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
2634

2735
LOWER_BOUND_CONSTRAINTS_FILE = CURRENT_DIRECTORY / "constraints.txt"
@@ -43,7 +51,7 @@
4351
"lint_setup_py",
4452
]
4553

46-
@nox.session(python=['3.6', '3.7', '3.8', '3.9', '3.10'])
54+
@nox.session(python=ALL_PYTHON)
4755
def unit(session):
4856
"""Run the unit test suite."""
4957

@@ -73,7 +81,7 @@ def cover(session):
7381
session.run("coverage", "erase")
7482

7583

76-
@nox.session(python=['3.6', '3.7', '3.8', '3.9'])
84+
@nox.session(python=ALL_PYTHON)
7785
def mypy(session):
7886
"""Run the type checker."""
7987
session.install('mypy', 'types-pkg_resources')

tests/integration/goldens/asset/setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
'Programming Language :: Python :: 3.7',
5252
'Programming Language :: Python :: 3.8',
5353
'Programming Language :: Python :: 3.9',
54+
'Programming Language :: Python :: 3.10',
5455
'Topic :: Internet',
5556
'Topic :: Software Development :: Libraries :: Python Modules',
5657
],

tests/integration/goldens/credentials/noxfile.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@
2222

2323
import nox # type: ignore
2424

25+
ALL_PYTHON = [
26+
"3.6",
27+
"3.7",
28+
"3.8",
29+
"3.9",
30+
"3.10",
31+
]
32+
2533
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
2634

2735
LOWER_BOUND_CONSTRAINTS_FILE = CURRENT_DIRECTORY / "constraints.txt"
@@ -43,7 +51,7 @@
4351
"lint_setup_py",
4452
]
4553

46-
@nox.session(python=['3.6', '3.7', '3.8', '3.9', '3.10'])
54+
@nox.session(python=ALL_PYTHON)
4755
def unit(session):
4856
"""Run the unit test suite."""
4957

@@ -73,7 +81,7 @@ def cover(session):
7381
session.run("coverage", "erase")
7482

7583

76-
@nox.session(python=['3.6', '3.7', '3.8', '3.9'])
84+
@nox.session(python=ALL_PYTHON)
7785
def mypy(session):
7886
"""Run the type checker."""
7987
session.install('mypy', 'types-pkg_resources')

tests/integration/goldens/credentials/setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
'Programming Language :: Python :: 3.7',
5151
'Programming Language :: Python :: 3.8',
5252
'Programming Language :: Python :: 3.9',
53+
'Programming Language :: Python :: 3.10',
5354
'Topic :: Internet',
5455
'Topic :: Software Development :: Libraries :: Python Modules',
5556
],

0 commit comments

Comments
 (0)