Skip to content

Commit

Permalink
BUG: fix version comparison (#10)
Browse files Browse the repository at this point in the history
* fix: fix version comparison that works for mpl >= 3.10

* docs: update rtd config
  • Loading branch information
ianhi authored Feb 22, 2025
1 parent f2f956b commit daca436
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
21 changes: 14 additions & 7 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
version: 2
python:
version: 3.8
install:
- method: pip
path: .
extra_requirements:
- doc


# Set the OS, Python version and other tools you might need

build:
os: ubuntu-22.04
tools:
python: "3.12"

python:
install:
- method: pip
path: .
extra_requirements:
- doc
# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ classifiers = [
]
dynamic = ["version"]
dependencies = [
"matplotlib",
"matplotlib>=3.5",
"mpl-pan-zoom",
"numpy",
]
Expand Down
4 changes: 2 additions & 2 deletions src/mpl_image_segmenter/_segmenter.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from typing import TYPE_CHECKING

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

if mpl_version < "3.7":
if mpl_version_info < (3, 7):
self.lasso = LassoSelector(
self.ax,
self._onselect,
Expand Down

0 comments on commit daca436

Please sign in to comment.