Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions doc/changes/unreleased.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# Unreleased

## Summary

This major release removes the deprecated matrix sessions ``matrix:all``,
``matrix:exasol``, and ``matrix:python``. Projects should use ``matrix.yml`` together
with the ``matrix:generate`` Nox session instead.

## Refactoring

* #859: Removed the deprecated ``matrix:all``, ``matrix:exasol``, and ``matrix:python``
Nox sessions.
6 changes: 0 additions & 6 deletions doc/user_guide/features/github_workflows/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,6 @@ Besides that, you can also create individual workflow files which are ignored by
Maintained by the PTB
^^^^^^^^^^^^^^^^^^^^^

.. note::
The ``matrix.yml`` workflow replaces the older ``matrix-all.yml``, ``matrix-exasol.yml``,
and ``matrix-python.yml`` workflows. The associated nox sessions (``matrix:all``,
``matrix:exasol``, and ``matrix:python``) are deprecated and will be removed
2026-09-15.

.. list-table::
:widths: 25 25 50
:header-rows: 1
Expand Down
73 changes: 0 additions & 73 deletions exasol/toolbox/nox/_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@
PROJECT_CONFIG,
)

# The relevant nox sessions will be removed in:
# https://github.com/exasol/python-toolbox/issues/859
MATRIX_DEPRECATION_DATE = "2026-09-15"


def _matrix_keys(config: BaseConfig) -> tuple[str, ...]:
"""
Expand Down Expand Up @@ -62,78 +58,9 @@ def _generate_matrix(config: BaseConfig, keys: Iterable[str]) -> dict[str, Any]:
}


def _deprecated_generate_matrix(
session: Session,
config: BaseConfig,
workflow_key_map: dict[str, str],
session_name: str,
replacement_args: str,
) -> None:
"""
Generate a JSON-serializable matrix subset from the project's config for a
deprecated workflow output.

``workflow_key_map`` maps the deprecated workflow-facing matrix keys to the
newer ``BaseConfig`` attribute names. The deprecated workflow keys keep
their existing dash-separated names because they are part of the external
CLI / GitHub Actions contract. The config keys use underscores because they
are Python identifiers and match the fields defined on ``BaseConfig``.
"""
matrix = _generate_matrix(config, workflow_key_map.values())
renamed_matrix: dict[str, Any] = {}
for output_key, config_key in workflow_key_map.items():
renamed_matrix[output_key] = matrix[config_key]
print(json.dumps(renamed_matrix))

session.warn(
f"Warning: `nox -s {session_name}` is deprecated and will be removed on "
f"{MATRIX_DEPRECATION_DATE}. Use `nox -s matrix:generate -- {replacement_args}` "
"instead."
)


@nox.session(name="matrix:generate", python=False)
def generate_matrix(session: Session) -> None:
"""Output selected BaseConfig values as JSON."""
keys = _matrix_args(session, PROJECT_CONFIG)
matrix = _generate_matrix(PROJECT_CONFIG, keys)
print(json.dumps(matrix))


@nox.session(name="matrix:python", python=False)
def python_matrix(session: Session) -> None:
"""Output the build matrix for Python versions as JSON."""
_deprecated_generate_matrix(
session=session,
config=PROJECT_CONFIG,
workflow_key_map={"python-version": "python_versions"},
session_name="matrix:python",
replacement_args="python_versions",
)


@nox.session(name="matrix:exasol", python=False)
def exasol_matrix(session: Session) -> None:
"""Output the build matrix for Exasol versions as JSON."""
_deprecated_generate_matrix(
session=session,
config=PROJECT_CONFIG,
workflow_key_map={"exasol-version": "exasol_versions"},
session_name="matrix:exasol",
replacement_args="exasol_versions",
)


@nox.session(name="matrix:all", python=False)
def full_matrix(session: Session) -> None:
"""Output the full build matrix for Python & Exasol versions as JSON."""
_deprecated_generate_matrix(
session=session,
config=PROJECT_CONFIG,
workflow_key_map={
"python-version": "python_versions",
"exasol-version": "exasol_versions",
},
session_name="matrix:all",
replacement_args="python_versions exasol_versions",
)
7 changes: 1 addition & 6 deletions exasol/toolbox/nox/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,7 @@ def check(session: Session) -> None:
get_filtered_python_files,
)

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

from exasol.toolbox.nox._release import prepare_release

Expand Down
41 changes: 0 additions & 41 deletions test/unit/nox/_matrix_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@
from exasol.toolbox.config import BaseConfig
from exasol.toolbox.nox._matrix import (
_generate_matrix,
exasol_matrix,
full_matrix,
generate_matrix,
python_matrix,
)


Expand Down Expand Up @@ -94,41 +91,3 @@ class TestGenerateMatrixHelper:
)
def test_returns_requested_keys(config, requested_keys, expected):
assert _generate_matrix(config, requested_keys) == expected


class TestDeprecatedMatrixSessions:
@staticmethod
def test_exasol_session_still_emits_field_names(
nox_session, config, caplog, capsys
):
with patch("exasol.toolbox.nox._matrix.PROJECT_CONFIG", new=config):
exasol_matrix(nox_session)

captured = capsys.readouterr()
assert json.loads(captured.out) == {"exasol-version": ["8.29.13", "2025.1.8"]}
assert len(caplog.messages) == 1

@staticmethod
def test_python_session_still_emits_field_names(
nox_session, config, caplog, capsys
):
with patch("exasol.toolbox.nox._matrix.PROJECT_CONFIG", new=config):
python_matrix(nox_session)

captured = capsys.readouterr()
assert json.loads(captured.out) == {
"python-version": ["3.10", "3.11", "3.12", "3.13", "3.14"]
}
assert len(caplog.messages) == 1

@staticmethod
def test_full_session_still_emits_field_names(nox_session, config, caplog, capsys):
with patch("exasol.toolbox.nox._matrix.PROJECT_CONFIG", new=config):
full_matrix(nox_session)

captured = capsys.readouterr()
assert json.loads(captured.out) == {
"python-version": ["3.10", "3.11", "3.12", "3.13", "3.14"],
"exasol-version": ["8.29.13", "2025.1.8"],
}
assert len(caplog.messages) == 1