Skip to content

Commit 477d12b

Browse files
brutasseAutomated
andauthored
ci: drop Python 3.9, add 3.14 (#84)
Also bump action versions and switch to more official myst parser for md (although we don't have md docs right now). --------- Co-authored-by: Automated <actions@users.noreply.github.com>
1 parent 03d5a86 commit 477d12b

6 files changed

Lines changed: 921 additions & 48 deletions

File tree

.github/workflows/fmt.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
name: Reformat code
3+
4+
on:
5+
push:
6+
branches-ignore:
7+
- main
8+
- master
9+
10+
jobs:
11+
fmt:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v6
15+
- name: Set up ruff
16+
run: curl -LsSf https://astral.sh/ruff/0.15.5/install.sh | sh
17+
- name: Reformat and push
18+
shell: bash
19+
run: |-
20+
ruff check --fix
21+
ruff format
22+
git config user.name "Automated"
23+
git config user.email "actions@users.noreply.github.com"
24+
timestamp=$(date -u)
25+
git commit -am "ruff: ${timestamp}" || exit 0
26+
git push
27+
echo "COMMITTED=1" >> "$GITHUB_ENV"
28+
- name: "Trigger build"
29+
run: |-
30+
if [ -z "$COMMITTED" ]; then
31+
echo "No commit"
32+
exit 0
33+
fi
34+
curl -L \
35+
-X POST \
36+
-H "Accept: application/vnd.github+json" \
37+
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
38+
-H "X-GitHub-Api-Version: 2022-11-28" \
39+
https://api.github.com/repos/exoscale/python-exoscale/actions/workflows/main.yml/dispatches \
40+
-d '{"ref": "'${{ github.ref }}'"}'

.github/workflows/main.yml

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name: CI
33

44
"on":
5+
workflow_dispatch:
56
push:
67
branches:
78
- '**'
@@ -19,28 +20,16 @@ jobs:
1920
strategy:
2021
fail-fast: false
2122
matrix:
22-
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
23+
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
2324
steps:
24-
- uses: actions/checkout@v4
25-
- uses: astral-sh/setup-uv@v3
25+
- uses: actions/checkout@v6
26+
- uses: astral-sh/setup-uv@v7
2627
with:
2728
enable-cache: true
28-
cache-dependency-glob: "pyproject.toml"
2929
- name: Tests
3030
run: |
3131
uv --version
3232
uv run --python ${{ matrix.python-version }} pytest
3333
env:
3434
EXOSCALE_API_KEY: ${{ secrets.EXOSCALE_API_KEY }}
3535
EXOSCALE_API_SECRET: ${{ secrets.EXOSCALE_API_SECRET }}
36-
lint:
37-
name: Linting
38-
runs-on: ubuntu-latest
39-
steps:
40-
- uses: actions/checkout@v4
41-
- name: Set up ruff
42-
run: curl -LsSf https://astral.sh/ruff/0.6.9/install.sh | sh
43-
- name: Lint
44-
shell: bash
45-
run: |-
46-
ruff check

docs/conf.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,7 @@
1111
# documentation root, use os.path.abspath to make it absolute, like shown here.
1212
#
1313
# import os
14-
import sys
1514
from datetime import datetime
16-
from sphinx_markdown_parser.parser import MarkdownParser # noqa
17-
18-
sys.path.insert(0, "exoscale")
1915

2016

2117
# -- Project information -----------------------------------------------------
@@ -32,7 +28,7 @@
3228
# Add any Sphinx extension module names here, as strings. They can be
3329
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
3430
# ones.
35-
extensions = ["sphinx.ext.autodoc", "sphinx.ext.napoleon", "recommonmark"]
31+
extensions = ["sphinx.ext.autodoc", "sphinx.ext.napoleon", "myst_parser"]
3632

3733
# Add any paths that contain templates here, relative to this directory.
3834
templates_path = ["_templates"]

pyproject.toml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@ authors = [{name="Exoscale", email="support@exoscale.com"}]
88
license = "ISC"
99
description = "Clients for Exoscale IaaS APIs"
1010
readme = "README.md"
11-
requires-python = ">=3.8"
11+
requires-python = ">=3.10"
1212
classifiers = [
1313
"Intended Audience :: Developers",
1414
"Intended Audience :: System Administrators",
1515
"License :: OSI Approved :: ISC License (ISCL)",
1616
"Operating System :: OS Independent",
1717
"Programming Language :: Python",
18-
"Programming Language :: Python :: 3.9",
1918
"Programming Language :: Python :: 3.10",
2019
"Programming Language :: Python :: 3.11",
2120
"Programming Language :: Python :: 3.12",
2221
"Programming Language :: Python :: 3.13",
22+
"Programming Language :: Python :: 3.14",
2323
]
2424
dependencies = [
2525
"requests-exoscale-auth>=1.1.2",
@@ -47,12 +47,11 @@ extend-select = ["B", "Q"]
4747
[tool.black]
4848
line-length = 79
4949

50-
[tool.uv]
51-
dev-dependencies = [
50+
[dependency-groups]
51+
dev = [
5252
"requests-mock>=1.12.1",
5353
"pytest>=5.0.0",
54-
"recommonmark>=0.5.0",
55-
"sphinx-markdown-parser>=0.1.1",
5654
"sphinx-rtd-theme>=0.4.3",
5755
"sphinx>=2.1.2",
56+
"myst-parser",
5857
]

tests/test_client.py

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -147,14 +147,17 @@ def test_wait_time_success(requests_mock):
147147
"https://api-ch-gva-2.exoscale.com/v2/operation/e2047130-b86e-11ef-83b3-0d8312b2c2d7", # noqa
148148
_mock_poll_response(3),
149149
)
150-
with patch(
151-
"exoscale.api.v2._time",
152-
side_effect=[
153-
0, # start of poll
154-
1, # duration of first loop: 1s
155-
5, # duration of second loop: 4s
156-
],
157-
) as time, patch("exoscale.api.v2._sleep") as sleep:
150+
with (
151+
patch(
152+
"exoscale.api.v2._time",
153+
side_effect=[
154+
0, # start of poll
155+
1, # duration of first loop: 1s
156+
5, # duration of second loop: 4s
157+
],
158+
) as time,
159+
patch("exoscale.api.v2._sleep") as sleep,
160+
):
158161
client = Client(key="EXOtest", secret="sdsd")
159162
client.wait(operation_id="e2047130-b86e-11ef-83b3-0d8312b2c2d7")
160163
assert len(time.call_args_list) == 3
@@ -166,12 +169,15 @@ def test_wait_time_poll_errors(requests_mock):
166169
"https://api-ch-gva-2.exoscale.com/v2/operation/e2047130-b86e-11ef-83b3-0d8312b2c2d7", # noqa
167170
_mock_poll_response(6, status_code=500),
168171
)
169-
with patch(
170-
"exoscale.api.v2._time",
171-
side_effect=[
172-
0, # start of poll
173-
],
174-
) as time, patch("exoscale.api.v2._sleep") as sleep:
172+
with (
173+
patch(
174+
"exoscale.api.v2._time",
175+
side_effect=[
176+
0, # start of poll
177+
],
178+
) as time,
179+
patch("exoscale.api.v2._sleep") as sleep,
180+
):
175181
client = Client(key="EXOtest", secret="sdsd")
176182
try:
177183
client.wait(operation_id="e2047130-b86e-11ef-83b3-0d8312b2c2d7")
@@ -188,14 +194,17 @@ def test_wait_time_failure(requests_mock):
188194
"https://api-ch-gva-2.exoscale.com/v2/operation/e2047130-b86e-11ef-83b3-0d8312b2c2d7", # noqa
189195
_mock_poll_response(3, result="failure"),
190196
)
191-
with patch(
192-
"exoscale.api.v2._time",
193-
side_effect=[
194-
0, # start of poll
195-
1, # duration of first loop: 1s
196-
5, # duration of second loop: 4s
197-
],
198-
) as time, patch("exoscale.api.v2._sleep") as sleep:
197+
with (
198+
patch(
199+
"exoscale.api.v2._time",
200+
side_effect=[
201+
0, # start of poll
202+
1, # duration of first loop: 1s
203+
5, # duration of second loop: 4s
204+
],
205+
) as time,
206+
patch("exoscale.api.v2._sleep") as sleep,
207+
):
199208
client = Client(key="EXOtest", secret="sdsd")
200209
try:
201210
client.wait(operation_id="e2047130-b86e-11ef-83b3-0d8312b2c2d7")

0 commit comments

Comments
 (0)