diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e4d000bb..583de754 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -50,10 +50,16 @@ jobs: - "3.9" - "3.10" - "3.11" - # - "3.12" + - "3.12" os: - ubuntu-latest - - macos-latest + # There shouldn't be any behavior differences between + # OSes, so we'll only run the test suite on Ubuntu for now. + # Also, since I (the main maintainer) develop on a macOS + # machine, I'll run the tests locally on macOS before + # merging any PRs or releasing new versions. This should + # be sufficient and will speed up the CI process... + # - macos-latest # - windows-latest fail-fast: true runs-on: ${{ matrix.os }} diff --git a/docs/reference/changelog.md b/docs/reference/changelog.md index e3baf043..34a39d11 100644 --- a/docs/reference/changelog.md +++ b/docs/reference/changelog.md @@ -16,6 +16,10 @@ Unreleased changes - Use `importlib.resources` to load data assets from within the package - to be PEP-302 compliant ({gh-issue}`176`) - Enforce "strict" mypy mode (mostly improved type annotations for generic types) ({gh-issue}`177`) +### CI/CD + +- Add support for Python 3.12 ({gh-issue}`182`) + --- 0.1.24 diff --git a/src/ridgeplot/_figure_factory.py b/src/ridgeplot/_figure_factory.py index dbe94bbe..482f645d 100644 --- a/src/ridgeplot/_figure_factory.py +++ b/src/ridgeplot/_figure_factory.py @@ -127,6 +127,8 @@ def get_xy_extrema(densities: Densities) -> tuple[Numeric, Numeric, Numeric, Num ... ) (-2, 4, 0, 4) """ + if len(densities) == 0: + raise ValueError("The densities array should not be empty.") x_flat: list[Numeric] = [] y_flat: list[Numeric] = [] for row in densities: diff --git a/tests/unit/test_figure_factory.py b/tests/unit/test_figure_factory.py index 54841114..4072b3b6 100644 --- a/tests/unit/test_figure_factory.py +++ b/tests/unit/test_figure_factory.py @@ -24,7 +24,7 @@ class TestGetXYExtrema: def test_raise_for_empty_sequence(self) -> None: # Fails for empty sequence - with pytest.raises(ValueError, match="arg is an empty sequence"): + with pytest.raises(ValueError, match="The densities array should not be empty"): get_xy_extrema(densities=[]) def test_raise_for_non_2d_array(self) -> None: