Skip to content

Commit ae50851

Browse files
authored
Add official support for python 3.10 and 3.11 (#6292)
2 parents 983f63f + 8f2fc19 commit ae50851

20 files changed

+2583
-646
lines changed

.github/actions/setup-python/action.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description:
44
Light wrapper around the actions/setup-python and actions/cache actions
55
to maintain the input vars in only one place for all workflows.
66

7-
input:
7+
inputs:
88
python-version:
99
description: Which version of python to install.
1010
required: true

.github/workflows/ci.yaml

+46-80
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
# also version tags, which include bugfix releases (eg: v3.4.0)
1212
- v[0-9]+.[0-9]+.[0-9]+
1313
pull_request:
14-
type: [opened, reopened, edited]
14+
types: [opened, reopened, synchronize]
1515
branches:
1616
# Only for PRs targeting those branches
1717
- master
@@ -44,7 +44,7 @@ jobs:
4444
# NOTE: We always want to run job on master since we run some additional checks there (code
4545
# coverage, etc)
4646
# if: ${{ needs.pre_job.outputs.should_skip != 'true' || github.ref == 'refs/heads/master' }}
47-
name: '${{ matrix.name }} - Python ${{ matrix.python-version-short }}'
47+
name: '${{ matrix.make.name }} - Python ${{ matrix.python.version-short }}'
4848
runs-on: ubuntu-20.04
4949
strategy:
5050
fail-fast: false
@@ -53,26 +53,18 @@ jobs:
5353
# each job runs subset of tests.
5454
# NOTE: We need to use full Python version as part of Python deps cache key otherwise
5555
# setup virtualenv step will fail.
56-
include:
56+
python:
57+
- {version-short: '3.8', version: '3.8.10'}
58+
- {version-short: '3.9', version: '3.9.14'}
59+
- {version-short: '3.10', version: '3.10.15'}
60+
- {version-short: '3.11', version: '3.11.10'}
61+
make:
5762
- name: 'Lint Checks (black, flake8, etc.)'
5863
task: 'ci-checks'
59-
python-version-short: '3.8'
60-
python-version: '3.8.10'
6164
- name: 'Compile (pip deps, pylint, etc.)'
6265
task: 'ci-compile'
63-
python-version-short: '3.8'
64-
python-version: '3.8.10'
65-
- name: 'Lint Checks (black, flake8, etc.)'
66-
task: 'ci-checks'
67-
python-version-short: '3.9'
68-
python-version: '3.9.14'
69-
- name: 'Compile (pip deps, pylint, etc.)'
70-
task: 'ci-compile'
71-
python-version-short: '3.9'
72-
python-version: '3.9.14'
73-
7466
env:
75-
TASK: '${{ matrix.task }}'
67+
TASK: '${{ matrix.make.task }}'
7668
COLUMNS: '120'
7769
PYLINT_CONCURRENCY: '6'
7870
steps:
@@ -81,10 +73,10 @@ jobs:
8173
- name: Custom Environment Setup
8274
run: |
8375
./scripts/github/setup-environment.sh
84-
- name: 'Set up Python (${{ matrix.python-version }}) and Cache Deps'
76+
- name: 'Set up Python (${{ matrix.python.version }}) and Cache Deps'
8577
uses: ./.github/actions/setup-python
8678
with:
87-
python-version: '${{ matrix.python-version }}'
79+
python-version: '${{ matrix.python.version }}'
8880
- name: Cache and Install APT Dependencies
8981
uses: ./.github/actions/apt-packages
9082
- name: Install virtualenv
@@ -109,15 +101,14 @@ jobs:
109101
110102
self-check:
111103
needs: pre_job
112-
name: '${{ matrix.name }} - Python ${{ matrix.python-version-short }}'
104+
# FIXME: dropping the repetition in this name requires changing required checks on GitHub
105+
name: 'Self-check on Python ${{ matrix.python.version-short }} - Python ${{ matrix.python.version-short }}'
113106
runs-on: ubuntu-20.04
114107
strategy:
115108
fail-fast: false
116109
matrix:
117-
include:
118-
- name: 'Self-check on Python 3.8'
119-
python-version-short: '3.8'
120-
python-version: '3.8.14'
110+
python:
111+
- {version-short: '3.8', version: '3.8.10'}
121112
services:
122113
mongo:
123114
image: mongo:7.0
@@ -163,10 +154,10 @@ jobs:
163154
- name: Custom Environment Setup
164155
run: |
165156
./scripts/github/setup-environment.sh
166-
- name: 'Set up Python (${{ matrix.python-version }}) and Cache Deps'
157+
- name: 'Set up Python (${{ matrix.python.version }}) and Cache Deps'
167158
uses: ./.github/actions/setup-python
168159
with:
169-
python-version: '${{ matrix.python-version }}'
160+
python-version: '${{ matrix.python.version }}'
170161
- name: Cache and Install APT Dependencies
171162
uses: ./.github/actions/apt-packages
172163
- name: Install virtualenv
@@ -238,7 +229,7 @@ jobs:
238229
if: ${{ failure() }}
239230
uses: actions/upload-artifact@v4
240231
with:
241-
name: logs-py${{ matrix.python-version }}
232+
name: logs-py${{ matrix.python.version }}
242233
path: logs.tar.gz
243234
retention-days: 7
244235

@@ -248,38 +239,29 @@ jobs:
248239
# coverage, etc)
249240
# NB: disabled. See TODO above pre_job
250241
# if: ${{ needs.pre_job.outputs.should_skip != 'true' || github.ref == 'refs/heads/master' }}
251-
name: '${{ matrix.name }} - Python ${{ matrix.python-version-short }}'
242+
name: '${{ matrix.make.name }} - Python ${{ matrix.python.version-short }}'
252243
runs-on: ubuntu-20.04
253244
strategy:
254245
fail-fast: false
255246
matrix:
256247
# NOTE: To speed the CI run, we split unit and integration tests into multiple jobs where
257248
# each job runs subset of tests.
258-
include:
259-
- name: 'Unit Tests (chunk 1)'
260-
task: 'ci-unit'
261-
shard: {k: 0, n: 2}
262-
python-version-short: '3.8'
263-
python-version: '3.8.10'
264-
- name: 'Unit Tests (chunk 2)'
265-
task: 'ci-unit'
266-
shard: {k: 1, n: 2}
267-
python-version-short: '3.8'
268-
python-version: '3.8.10'
249+
python:
250+
- {version-short: '3.8', version: '3.8.10'}
251+
- {version-short: '3.9', version: '3.9.14'}
252+
- {version-short: '3.10', version: '3.10.15'}
253+
- {version-short: '3.11', version: '3.11.10'}
254+
make:
269255
- name: 'Unit Tests (chunk 1)'
270256
task: 'ci-unit'
271257
shard: {k: 0, n: 2}
272-
python-version-short: '3.9'
273-
python-version: '3.9.14'
274258
- name: 'Unit Tests (chunk 2)'
275259
task: 'ci-unit'
276260
shard: {k: 1, n: 2}
277-
python-version-short: '3.9'
278-
python-version: '3.9.14'
261+
279262
# This job is slow so we only run in on a daily basis
280263
# - name: 'Micro Benchmarks'
281264
# task: 'micro-benchmarks'
282-
# python-version: '3.6.13'
283265
# shard: {k: 0, n: 1}
284266
services:
285267
mongo:
@@ -310,10 +292,10 @@ jobs:
310292
- 15672:15672/tcp # Management: HTTP, CLI
311293

312294
env:
313-
TASK: '${{ matrix.task }}'
314-
PYTHON_VERSION_SHORT: '${{ matrix.python-version-short }}'
315-
NODE_TOTAL: '${{ matrix.shard.n }}'
316-
NODE_INDEX: '${{ matrix.shard.k }}'
295+
TASK: '${{ matrix.make.task }}'
296+
PYTHON_VERSION_SHORT: '${{ matrix.python.version-short }}'
297+
NODE_TOTAL: '${{ matrix.make.shard.n }}'
298+
NODE_INDEX: '${{ matrix.make.shard.k }}'
317299

318300
# We need to explicitly specify terminal width otherwise some CLI tests fail on container
319301
# environments where small terminal size is used.
@@ -339,10 +321,10 @@ jobs:
339321
- name: Custom Environment Setup
340322
run: |
341323
./scripts/github/setup-environment.sh
342-
- name: 'Set up Python (${{ matrix.python-version }}) and Cache Deps'
324+
- name: 'Set up Python (${{ matrix.python.version }}) and Cache Deps'
343325
uses: ./.github/actions/setup-python
344326
with:
345-
python-version: '${{ matrix.python-version }}'
327+
python-version: '${{ matrix.python.version }}'
346328
- name: Cache and Install APT Dependencies
347329
uses: ./.github/actions/apt-packages
348330
- name: Install virtualenv
@@ -400,46 +382,30 @@ jobs:
400382
# NOTE: We always want to run job on master since we run some additional checks there (code
401383
# coverage, etc)
402384
# if: ${{ needs.pre_job.outputs.should_skip != 'true' || github.ref == 'refs/heads/master' }}
403-
name: '${{ matrix.name }} - Python ${{ matrix.python-version-short }}'
385+
name: '${{ matrix.make.name }} - Python ${{ matrix.python.version-short }}'
404386
runs-on: ubuntu-20.04
405387
strategy:
406388
fail-fast: false
407389
matrix:
408390
# NOTE: To speed the CI run, we split unit and integration tests into multiple jobs where
409391
# each job runs subset of tests.
410-
include:
392+
python:
393+
- {version-short: '3.8', version: '3.8.10'}
394+
- {version-short: '3.9', version: '3.9.14'}
395+
- {version-short: '3.10', version: '3.10.15'}
396+
- {version-short: '3.11', version: '3.11.10'}
397+
make:
411398
# We run pack tests here since they rely on some integration tests set
412399
# up (aka stanley user being present, etc.)
413400
- name: 'Pack Tests'
414401
task: 'ci-packs-tests'
415402
shard: {k: 0, n: 1}
416-
python-version-short: '3.8'
417-
python-version: '3.8.10'
418-
- name: 'Integration Tests (chunk 1)'
419-
task: 'ci-integration'
420-
shard: {k: 0, n: 2}
421-
python-version-short: '3.8'
422-
python-version: '3.8.10'
423-
- name: 'Integration Tests (chunk 2)'
424-
task: 'ci-integration'
425-
shard: {k: 1, n: 2}
426-
python-version-short: '3.8'
427-
python-version: '3.8.10'
428-
- name: 'Pack Tests'
429-
task: 'ci-packs-tests'
430-
shard: {k: 0, n: 1}
431-
python-version-short: '3.9'
432-
python-version: '3.9.14'
433403
- name: 'Integration Tests (chunk 1)'
434404
task: 'ci-integration'
435405
shard: {k: 0, n: 2}
436-
python-version-short: '3.9'
437-
python-version: '3.9.14'
438406
- name: 'Integration Tests (chunk 2)'
439407
task: 'ci-integration'
440408
shard: {k: 1, n: 2}
441-
python-version-short: '3.9'
442-
python-version: '3.9.14'
443409
services:
444410
mongo:
445411
image: mongo:7.0
@@ -491,10 +457,10 @@ jobs:
491457
- 6379:6379/tcp
492458

493459
env:
494-
TASK: '${{ matrix.task }}'
495-
PYTHON_VERSION_SHORT: '${{ matrix.python-version-short }}'
496-
NODE_TOTAL: '${{ matrix.shard.n }}'
497-
NODE_INDEX: '${{ matrix.shard.k }}'
460+
TASK: '${{ matrix.make.task }}'
461+
PYTHON_VERSION_SHORT: '${{ matrix.python.version-short }}'
462+
NODE_TOTAL: '${{ matrix.make.shard.n }}'
463+
NODE_INDEX: '${{ matrix.make.shard.k }}'
498464

499465
# We need to explicitly specify terminal width otherwise some CLI tests fail on container
500466
# environments where small terminal size is used.
@@ -521,10 +487,10 @@ jobs:
521487
- name: Custom Environment Setup
522488
run: |
523489
./scripts/github/setup-environment.sh
524-
- name: 'Set up Python (${{ matrix.python-version }}) and Cache Deps'
490+
- name: 'Set up Python (${{ matrix.python.version }}) and Cache Deps'
525491
uses: ./.github/actions/setup-python
526492
with:
527-
python-version: '${{ matrix.python-version }}'
493+
python-version: '${{ matrix.python.version }}'
528494
- name: Cache and Install APT Dependencies
529495
uses: ./.github/actions/apt-packages
530496
- name: Install virtualenv
@@ -580,7 +546,7 @@ jobs:
580546
if: ${{ failure() && env.TASK == 'ci-integration' }}
581547
uses: actions/upload-artifact@v4
582548
with:
583-
name: logs-py${{ matrix.python-version }}-pytest-${{ matrix.shard.k }}
549+
name: logs-py${{ matrix.python.version }}-pytest-${{ matrix.make.shard.k }}
584550
path: logs.tar.gz
585551
retention-days: 7
586552

.github/workflows/lint.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313
# also version tags, which include bugfix releases (eg: v3.4.0)
1414
- v[0-9]+.[0-9]+.[0-9]+
1515
pull_request:
16-
type: [opened, reopened, edited]
16+
types: [opened, reopened, synchronize]
1717
branches:
1818
# Only for PRs targeting those branches
1919
- master

.github/workflows/microbenchmarks.yaml

+23-15
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ name: Micro Benchmarks
55
on:
66
schedule:
77
- cron: '30 3 * * *'
8+
pull_request:
9+
types: [opened, reopened, synchronize]
10+
branches:
11+
# Only for PRs targeting those branches
12+
- master
13+
- v[0-9]+.[0-9]+
14+
paths:
15+
# Only for PRs that touch the benchmarks
16+
- .github/workflows/microbenchmarks.yaml
17+
- st2common/benchmarks/**
818

919
jobs:
1020
# Special job which automatically cancels old runs for the same branch, prevents runs for the
@@ -26,24 +36,22 @@ jobs:
2636
# NOTE: We always want to run job on master since we run some additional checks there (code
2737
# coverage, etc)
2838
if: ${{ needs.pre_job.outputs.should_skip != 'true' || github.ref == 'refs/heads/master' }}
29-
name: '${{ matrix.name }} - Python ${{ matrix.python-version-short }}'
39+
name: '${{ matrix.make.name }} - Python ${{ matrix.python.version-short }}'
3040
runs-on: ubuntu-20.04
3141
strategy:
3242
fail-fast: false
3343
matrix:
3444
# NOTE: We need to use full Python version as part of Python deps cache key otherwise
3545
# setup virtualenv step will fail.
36-
include:
46+
python:
47+
- {version-short: '3.8', version: '3.8.10'}
48+
- {version-short: '3.9', version: '3.9.14'}
49+
- {version-short: '3.10', version: '3.10.15'}
50+
- {version-short: '3.11', version: '3.11.10'}
51+
make:
3752
- name: 'Microbenchmarks'
3853
task: 'micro-benchmarks'
3954
shard: {k: 0, n: 1}
40-
python-version-short: '3.8'
41-
python-version: '3.8.10'
42-
- name: 'Microbenchmarks'
43-
task: 'micro-benchmarks'
44-
shard: {k: 0, n: 1}
45-
python-version-short: '3.9'
46-
python-version: '3.9.14'
4755
services:
4856
mongo:
4957
image: mongo:7.0
@@ -60,10 +68,10 @@ jobs:
6068
- 15672:15672/tcp # Management: HTTP, CLI
6169

6270
env:
63-
TASK: '${{ matrix.task }}'
71+
TASK: '${{ matrix.make.task }}'
6472

65-
NODE_TOTAL: '${{ matrix.shard.n }}'
66-
NODE_INDEX: '${{ matrix.shard.k }}'
73+
NODE_TOTAL: '${{ matrix.make.shard.n }}'
74+
NODE_INDEX: '${{ matrix.make.shard.k }}'
6775

6876
COLUMNS: '120'
6977
ST2_CI: 'true'
@@ -73,10 +81,10 @@ jobs:
7381
steps:
7482
- name: Checkout repository
7583
uses: actions/checkout@v4
76-
- name: 'Set up Python (${{ matrix.python-version }}) and Cache Deps'
84+
- name: 'Set up Python (${{ matrix.python.version }}) and Cache Deps'
7785
uses: ./.github/actions/setup-python
7886
with:
79-
python-version: '${{ matrix.python-version }}'
87+
python-version: '${{ matrix.python.version }}'
8088
- name: Cache and Install APT Dependencies
8189
uses: ./.github/actions/apt-packages
8290
- name: Install virtualenv
@@ -96,7 +104,7 @@ jobs:
96104
- name: Upload Histograms
97105
uses: actions/upload-artifact@v4
98106
with:
99-
name: benchmark_histograms-py${{ matrix.python-version }}
107+
name: benchmark_histograms-py${{ matrix.python.version }}
100108
path: benchmark_histograms/
101109
retention-days: 30
102110

0 commit comments

Comments
 (0)