Skip to content

Commit

Permalink
Add nox tasks to output python and exasol versions for builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicoretti committed Dec 11, 2024
1 parent 1efa3b5 commit 3874fca
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
32 changes: 32 additions & 0 deletions exasol/toolbox/nox/_ci.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import json

import nox
from nox import Session


def _python_matrix():
return {"python-version": ["3.9", "3.10", "3.11", "3.12"]}


def _exasol_matrix():
return {"exasol-version": ["7.1.9"]}


@nox.session(name="matrix:python", python=False)
def python_matrix(session: Session) -> None:
"""Output the build matrix for Python versions as JSON."""
print(json.dumps(_python_matrix()))


@nox.session(name="matrix:exasol", python=False)
def exasol_matrix(session: Session) -> None:
"""Output the build matrix for Exasol versions as JSON."""
print(json.dumps(_exasol_matrix()))


@nox.session(name="matrix:all", python=False)
def full_matrix(session: Session) -> None:
"""Output the full build matrix for Python & Exasol versions as JSON."""
matrix = _python_matrix()
matrix.update(_exasol_matrix())
print(json.dumps(matrix))
8 changes: 7 additions & 1 deletion exasol/toolbox/nox/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,20 @@ def check(session: Session) -> None:
clean_docs,
open_docs,
)
from exasol.toolbox.nox._release import prepare_release
from exasol.toolbox.nox._shared import (
Mode,
_context,
_version,
python_files,
)

from exasol.toolbox.nox._ci import (
python_matrix,
exasol_matrix,
full_matrix,
)

from exasol.toolbox.nox._release import prepare_release

# isort: on
# fmt: on

0 comments on commit 3874fca

Please sign in to comment.