Skip to content

Commit 3874fca

Browse files
committed
Add nox tasks to output python and exasol versions for builds
1 parent 1efa3b5 commit 3874fca

File tree

2 files changed

+39
-1
lines changed

2 files changed

+39
-1
lines changed

exasol/toolbox/nox/_ci.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import json
2+
3+
import nox
4+
from nox import Session
5+
6+
7+
def _python_matrix():
8+
return {"python-version": ["3.9", "3.10", "3.11", "3.12"]}
9+
10+
11+
def _exasol_matrix():
12+
return {"exasol-version": ["7.1.9"]}
13+
14+
15+
@nox.session(name="matrix:python", python=False)
16+
def python_matrix(session: Session) -> None:
17+
"""Output the build matrix for Python versions as JSON."""
18+
print(json.dumps(_python_matrix()))
19+
20+
21+
@nox.session(name="matrix:exasol", python=False)
22+
def exasol_matrix(session: Session) -> None:
23+
"""Output the build matrix for Exasol versions as JSON."""
24+
print(json.dumps(_exasol_matrix()))
25+
26+
27+
@nox.session(name="matrix:all", python=False)
28+
def full_matrix(session: Session) -> None:
29+
"""Output the full build matrix for Python & Exasol versions as JSON."""
30+
matrix = _python_matrix()
31+
matrix.update(_exasol_matrix())
32+
print(json.dumps(matrix))

exasol/toolbox/nox/tasks.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,20 @@ def check(session: Session) -> None:
5959
clean_docs,
6060
open_docs,
6161
)
62-
from exasol.toolbox.nox._release import prepare_release
6362
from exasol.toolbox.nox._shared import (
6463
Mode,
6564
_context,
6665
_version,
6766
python_files,
6867
)
6968

69+
from exasol.toolbox.nox._ci import (
70+
python_matrix,
71+
exasol_matrix,
72+
full_matrix,
73+
)
74+
75+
from exasol.toolbox.nox._release import prepare_release
7076

7177
# isort: on
7278
# fmt: on

0 commit comments

Comments
 (0)