Skip to content

Commit 2adbb15

Browse files
committed
Merge branch 'main' into dependabot/github_actions/actions/download-artifact-5
2 parents 7ef9fd1 + cd0d133 commit 2adbb15

8 files changed

Lines changed: 52 additions & 50 deletions

File tree

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ default_language_version:
33

44
repos:
55
- repo: https://github.com/pre-commit/pre-commit-hooks
6-
rev: v5.0.0
6+
rev: v6.0.0
77
hooks:
88
- id: check-added-large-files
99
args: [ '--maxkb=500' ]
@@ -43,7 +43,7 @@ repos:
4343
exclude: ^\.bumpversion\.cfg$
4444

4545
- repo: https://github.com/python-jsonschema/check-jsonschema.git
46-
rev: 0.31.3
46+
rev: 0.33.3
4747
hooks:
4848
- id: check-github-actions
4949
- id: check-github-workflows
@@ -72,7 +72,7 @@ repos:
7272
exclude: ^docs/_static/.*\.(js|html)$|^src/ridgeplot/.*\.c$
7373

7474
- repo: https://github.com/shellcheck-py/shellcheck-py
75-
rev: v0.10.0.1
75+
rev: v0.11.0.1
7676
hooks:
7777
- id: shellcheck
7878

@@ -102,7 +102,7 @@ repos:
102102
additional_dependencies: [setuptools-scm]
103103

104104
- repo: https://github.com/astral-sh/ruff-pre-commit
105-
rev: v0.11.2
105+
rev: v0.12.10
106106
hooks:
107107
- id: ruff-format
108108
- id: ruff

cicd_utils/cicd/test_helpers.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from importlib.util import module_from_spec, spec_from_file_location
77
from pathlib import Path
88
from typing import TYPE_CHECKING, Any, TypeVar, cast
9+
from unittest.mock import MagicMock, patch
910

1011
if TYPE_CHECKING:
1112
from collections.abc import Iterator
@@ -22,8 +23,6 @@ def patch_plotly_show() -> Iterator[None]:
2223
and, instead, simply call
2324
:func:`plotly.io._utils.validate_coerce_fig_to_dict()`.
2425
"""
25-
from unittest.mock import MagicMock, patch
26-
2726
from plotly.io._utils import validate_coerce_fig_to_dict
2827

2928
def patched(

docs/conf.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from __future__ import annotations
22

3+
import importlib.metadata
34
import sys
45
from contextlib import contextmanager
56
from datetime import datetime
@@ -9,11 +10,6 @@
910

1011
from typing_extensions import Any
1112

12-
try:
13-
import importlib.metadata as importlib_metadata
14-
except ImportError:
15-
import importlib_metadata
16-
1713
try:
1814
from ridgeplot_examples import ALL_EXAMPLES
1915
except ImportError:
@@ -40,7 +36,7 @@
4036

4137
# -- Project information ---------------------------------------------------------------------------
4238

43-
metadata = importlib_metadata.metadata("ridgeplot")
39+
metadata = importlib.metadata.metadata("ridgeplot")
4440

4541
project = project_name = name = metadata["name"]
4642
author = metadata["author"]

mypy.ini

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ plugins = numpy.typing.mypy_plugin
4242
;show_traceback = True
4343
;raise_exceptions = True
4444

45-
[mypy-importlib_metadata.*]
46-
ignore_missing_imports = True
4745
[mypy-importlib_resources.*]
4846
ignore_missing_imports = True
4947
[mypy-plotly.*]

pytest.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,5 @@ filterwarnings =
5353
ignore:is_categorical_dtype.*:DeprecationWarning
5454
# Ignore pandas' missing Pyarrow dependency warning
5555
ignore:\nPyarrow will become a required dependency.*:DeprecationWarning
56+
# Ignore Plotly's Kaleido deprecation warning
57+
ignore:\nUse of plotly\.io\.kaleido\.scope.* is deprecated.*:DeprecationWarning

ruff.toml

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,29 @@ ignore = [
2222
"FBT", # flake8-boolean-trap
2323
"FIX", # flake8-fixme
2424

25-
# flake8-comprehensions
25+
# flake8-commas (COM)
26+
"COM812", # Trailing comma missing
27+
28+
# flake8-comprehensions (C4)
2629
"C408", # Unnecessary `dict` call (rewrite as a literal)
2730

28-
# pydocstyle
31+
# flake8-errmsg (EM)
32+
"EM101", # Exception must not use a string literal, assign to variable first
33+
"EM102", # Exception must not use an f-string literal, assign to variable first
34+
"EM103", # Exception must not use a .format() string directly, assign to variable first
35+
36+
# flake8-return (RET)
37+
"RET504", # Unnecessary variable assignment before `return` statement
38+
39+
# flake8-todos (TD)
40+
"TD001", # Invalid TODO tag: `FIXME`
41+
"TD002", # Missing author in [...]
42+
"TD003", # Missing issue link on the line following this TODO
43+
44+
# flake8-annotations (ANN)
45+
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed in {name}
46+
47+
# pydocstyle (D)
2948
"D101", # Missing docstring in public class
3049
"D102", # Missing docstring in public method
3150
"D103", # Missing docstring in public function
@@ -36,43 +55,27 @@ ignore = [
3655
"D400", # First line should end with a period
3756
"D415", # First line should end with a period, question mark, or exclamation point
3857

39-
# flake8-return
40-
"RET504", # Unnecessary variable assignment before `return` statement
41-
4258
# eradicate (ERA)
4359
"ERA001", # Found commented-out code
4460

45-
# pandas-vet
61+
# pandas-vet (PD)
4662
"PD015", # Use `.merge` method instead of `pd.merge` function. They have equivalent functionality.
4763
"PD901", # `df` is a bad variable name. Be kinder to your future self.
4864

49-
# pylint
65+
# Convention (PLC)
66+
"PLC0415", # `import` should be at the top-level of a file
67+
68+
# Refactor (PLR)
5069
"PLR0913", # Too many arguments to function call ({x} > 5)
5170
"PLR2004", # Magic value used in comparison, consider replacing {x} with a constant variable
5271

5372
# tryceratops
5473
"TRY003", # Avoid specifying long messages outside the exception class
5574

56-
# flake8-commas (COM)
57-
"COM812", # Trailing comma missing
58-
59-
# flake8-errmsg (EM)
60-
"EM101", # Exception must not use a string literal, assign to variable first
61-
"EM102", # Exception must not use an f-string literal, assign to variable first
62-
"EM103", # Exception must not use a .format() string directly, assign to variable first
63-
6475
# pep8-naming
6576
# (allow for sklearn's naming convention for uppercase `X`)
6677
"N803", # Argument name should be lowercase
6778
"N806", # Variable in function should be lowercase
68-
69-
# flake8-todos (TD)
70-
"TD001", # Invalid TODO tag: `FIXME`
71-
"TD002", # Missing author in [...]
72-
"TD003", # Missing issue link on the line following this TODO
73-
74-
# flake8-annotations (ANN)
75-
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed in {name}
7679
]
7780

7881
[lint.per-file-ignores]

src/ridgeplot/_utils.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
from collections.abc import Collection
66
from typing import TYPE_CHECKING
77

8-
from typing_extensions import (
9-
TypeVar,
10-
)
8+
from typing_extensions import TypeVar
119

1210
if TYPE_CHECKING:
1311
from typing_extensions import Any

tests/unit/color/test_utils.py

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from __future__ import annotations
22

3+
import re
34
from typing import TYPE_CHECKING, Any
45

56
import pytest
@@ -45,26 +46,31 @@ def test_to_rgb(color: Color, expected: str) -> None:
4546
("color", "expected_exception", "exception_match"),
4647
[
4748
# invalid types
48-
(1, TypeError, None),
49-
([1, 2, 3], TypeError, None),
49+
(1, TypeError, "Expected str or tuple for color, got <class 'int'> instead"),
50+
([1, 2, 3], TypeError, "Expected str or tuple for color, got <class 'list'> instead"),
5051
# invalid CSS named color
51-
("not-a-color", ValueError, None),
52+
(
53+
"not-a-color",
54+
ValueError,
55+
"color should be a tuple or a str representation of a "
56+
"hex or rgb color, got 'not-a-color' instead",
57+
),
5258
# invalid hex
53-
("#1234567890", ValueError, r"too many values to unpack \(expected 3\)"),
54-
("#ABCDEFGHIJ", ValueError, r"invalid literal for int\(\) with base 16"),
59+
("#1234567890", ValueError, "too many values to unpack (expected 3)"),
60+
("#ABCDEFGHIJ", ValueError, "invalid literal for int() with base 16"),
5561
# invalid rgb
56-
("rgb(0,0,999)", PlotlyError, r"rgb colors tuples cannot exceed 255"),
62+
("rgb(0,0,999)", PlotlyError, "rgb colors tuples cannot exceed 255"),
5763
# invalid tuple
58-
((1, 2), ValueError, r"not enough values to unpack \(expected 3, got 2\)"),
59-
((1, 2, 3, 4), ValueError, r"too many values to unpack \(expected 3\)"),
64+
((1, 2), ValueError, "not enough values to unpack (expected 3, got 2)"),
65+
((1, 2, 3, 4), ValueError, "too many values to unpack (expected 3)"),
6066
],
6167
)
6268
def test_to_rgb_fails_for_invalid_color(
6369
color: Any,
6470
expected_exception: type[Exception],
65-
exception_match: str | None,
71+
exception_match: str,
6672
) -> None:
67-
with pytest.raises(expected_exception, match=exception_match or ""):
73+
with pytest.raises(expected_exception, match=re.escape(exception_match)):
6874
to_rgb(color)
6975

7076

0 commit comments

Comments
 (0)