Skip to content

Commit b782ecf

Browse files
authored
Adding python 3.12 support (#173)
* Adding py3.12 support to test matrix. * Turning on fail-fast * If branch name ends with -fulltest then the full test suite runs in PR. I think. * fulltest * Bumping version to v0.13.0 * Undoing the hallucinated max-retry option. * Dropping python for running the tests back to 3.10 since the linter started barfing on simple imports when I bumped it to 3.11. * Trying to get "-fulltest" branch suffix to work. * Downgrading poetry. * Trying Michael's suggestion about different pythons for poetry & test. * Taking out redundant python install.
1 parent e21524d commit b782ecf

File tree

2 files changed

+36
-21
lines changed

2 files changed

+36
-21
lines changed

.github/workflows/cicd.yaml

Lines changed: 35 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ on:
66

77
env:
88
PYTHON_VERSION: "3.10"
9-
POETRY_VERSION: "1.5.1"
9+
POETRY_VERSION: "1.7.1"
1010
jobs:
1111
# Run our linter on every push to the repository.
1212
lint:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- name: get code
16-
uses: actions/checkout@v3
16+
uses: actions/checkout@v4
1717
- name: install python
1818
uses: actions/setup-python@v4
1919
with:
@@ -38,7 +38,7 @@ jobs:
3838
runs-on: ubuntu-latest
3939
steps:
4040
- name: get code
41-
uses: actions/checkout@v3
41+
uses: actions/checkout@v4
4242
- name: install python
4343
uses: actions/setup-python@v4
4444
with:
@@ -72,7 +72,7 @@ jobs:
7272
working-directory: docs/
7373
steps:
7474
- name: Get code
75-
uses: actions/checkout@v3
75+
uses: actions/checkout@v4
7676
- name: Setup npm
7777
uses: actions/setup-node@v3
7878
with:
@@ -88,7 +88,7 @@ jobs:
8888
runs-on: ubuntu-latest
8989
steps:
9090
- name: get code
91-
uses: actions/checkout@v3
91+
uses: actions/checkout@v4
9292
- name: install python
9393
uses: actions/setup-python@v4
9494
with:
@@ -107,42 +107,57 @@ jobs:
107107
108108
# Run integration tests against the API (only on the main branch, though). The comprehensive
109109
# version runs a matrix of python versions for better coverage.
110+
# This tests runs on
111+
# - merges to main
112+
# - releases
113+
# - branch names ending with "-fulltest"
110114
test-comprehensive:
111-
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
115+
if: >-
116+
github.ref == 'refs/heads/main' ||
117+
startsWith(github.ref, 'refs/tags/v') ||
118+
endsWith(github.ref, '-fulltest')
112119
needs:
113120
- test-simple
114121
- test-docs
115122
runs-on: ubuntu-latest
116123
strategy:
117-
# It's totally debatable which is better here: fail-fast or not.
118-
# Failing fast will use fewer cloud resources, in theory.
119-
# But if the tests are slightly flaky (fail to pip install something)
120-
# Then one flaky install kills lots of jobs that need to be redone.
121-
# So the efficiency argument has its limits
122-
# Failing slow is clearer about what's going on.
123-
# This is pretty unambiguous, so we're going with it for now.
124+
# fail-fast=false works best for flaky tests with manual "retry failed".
125+
# Of course we should get rid of the race conditions that make these tests flaky.
126+
# Some AI lied to me and said I could just put "max-retry" here but you can't.
124127
fail-fast: false
125128
matrix:
126129
python-version: [
127130
#"3.6", # Default on Ubuntu18.04 but openapi-generator fails
128-
"3.7",
131+
"3.7", # EOL but we're still supporting it for now.
129132
"3.8",
130133
"3.9",
131134
"3.10",
132135
"3.11",
136+
"3.12",
133137
]
134138
install_extras: [true, false]
135139
steps:
136140
- name: get code
137-
uses: actions/checkout@v3
138-
- name: install python
141+
uses: actions/checkout@v4
142+
- name: install modern python for poetry
139143
uses: actions/setup-python@v4
140144
with:
141-
python-version: ${{ matrix.python-version }}
145+
# We use this python to install poetry -- we choose a modern version
146+
python-version: ${{ env.PYTHON_VERSION }}
142147
- name: install poetry
143148
uses: snok/install-poetry@v1
144149
with:
145150
version: ${{ env.POETRY_VERSION }}
151+
- name: install python for python-sdk venv
152+
uses: actions/setup-python@v4
153+
with:
154+
# We use this python for the sdk venv
155+
python-version: ${{ matrix.python-version }}
156+
- name: choose python version ${{ matrix.python-version }}
157+
run: |
158+
# set the environment to use the matrix python version
159+
poetry env use python${{ matrix.python-version }}
160+
poetry run python --version
146161
- name: show python version ${{ matrix.python-version }}
147162
run: |
148163
poetry run python --version
@@ -170,7 +185,7 @@ jobs:
170185
runs-on: ubuntu-latest
171186
steps:
172187
- name: get code
173-
uses: actions/checkout@v3
188+
uses: actions/checkout@v4
174189
with:
175190
ref: ${{ github.head_ref }}
176191
- name: install python
@@ -219,7 +234,7 @@ jobs:
219234
working-directory: docs/
220235
steps:
221236
- name: Get code
222-
uses: actions/checkout@v3
237+
uses: actions/checkout@v4
223238
- name: Install poetry
224239
uses: snok/install-poetry@v1
225240
with:
@@ -268,7 +283,7 @@ jobs:
268283
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_PUBLISH_TOKEN }}
269284
steps:
270285
- name: get code
271-
uses: actions/checkout@v3
286+
uses: actions/checkout@v4
272287
- name: install python
273288
uses: actions/setup-python@v4
274289
with:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ packages = [
99
{include = "**/*.py", from = "src"},
1010
]
1111
readme = "README.md"
12-
version = "0.13.3"
12+
version = "0.14.0"
1313

1414
[tool.poetry.dependencies]
1515
# For certifi, use ">=" instead of "^" since it upgrades its "major version" every year, not really following semver

0 commit comments

Comments
 (0)