Skip to content

Commit daca436

Browse files
authored
BUG: fix version comparison (#10)
* fix: fix version comparison that works for mpl >= 3.10 * docs: update rtd config
1 parent f2f956b commit daca436

File tree

3 files changed

+17
-10
lines changed

3 files changed

+17
-10
lines changed

.readthedocs.yaml

+14-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
version: 2
2-
python:
3-
version: 3.8
4-
install:
5-
- method: pip
6-
path: .
7-
extra_requirements:
8-
- doc
92

3+
4+
# Set the OS, Python version and other tools you might need
5+
6+
build:
7+
os: ubuntu-22.04
8+
tools:
9+
python: "3.12"
10+
11+
python:
12+
install:
13+
- method: pip
14+
path: .
15+
extra_requirements:
16+
- doc
1017
# Build documentation in the docs/ directory with Sphinx
1118
sphinx:
1219
configuration: docs/conf.py

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ classifiers = [
2424
]
2525
dynamic = ["version"]
2626
dependencies = [
27-
"matplotlib",
27+
"matplotlib>=3.5",
2828
"mpl-pan-zoom",
2929
"numpy",
3030
]

src/mpl_image_segmenter/_segmenter.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from typing import TYPE_CHECKING
55

66
import numpy as np
7-
from matplotlib import __version__ as mpl_version
7+
from matplotlib import __version_info__ as mpl_version_info
88
from matplotlib import get_backend
99
from matplotlib.colors import TABLEAU_COLORS, XKCD_COLORS, to_rgba_array
1010
from matplotlib.path import Path
@@ -126,7 +126,7 @@ def __init__( # type: ignore
126126
if isinstance(lasso_mousebutton, str):
127127
lasso_mousebutton = button_dict[lasso_mousebutton.lower()]
128128

129-
if mpl_version < "3.7":
129+
if mpl_version_info < (3, 7):
130130
self.lasso = LassoSelector(
131131
self.ax,
132132
self._onselect,

0 commit comments

Comments
 (0)