Skip to content

Commit

Permalink
Increase minimally-supported versions of Python and dependencies (#3208)
Browse files Browse the repository at this point in the history
* Increase minimally-supported versions of Python and dependencies

* Update pinned versions in file that CI workflow reads from

* Put better guards around pandas extension dtype comparisons

* Adjust backcompat gate
  • Loading branch information
mwaskom authored Jan 2, 2023
1 parent fd09815 commit 7b70380
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 28 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Setup Python 3.10
- name: Setup Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.11"

- name: Install seaborn
run: |
Expand Down Expand Up @@ -53,15 +53,15 @@ jobs:

strategy:
matrix:
python: ["3.7", "3.8", "3.9", "3.10"]
python: ["3.8", "3.9", "3.10", "3.11"]
install: [full]
deps: [latest]

include:
- python: "3.7"
- python: "3.8"
install: full
deps: pinned
- python: "3.10"
- python: "3.11"
install: light
deps: latest

Expand Down
13 changes: 5 additions & 8 deletions ci/deps_pinned.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
numpy~=1.17.0
pandas~=0.25.0
matplotlib~=3.1.0
scipy~=1.3.0
statsmodels~=0.10.0
# Pillow added in install_requires for later matplotlibs
pillow>=6.2.0
typing_extensions
numpy~=1.20.0
pandas~=1.2.0
matplotlib~=3.3.0
scipy~=1.7.0
statsmodels~=0.12.0
15 changes: 7 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,27 @@ license = {file = "LICENSE.md"}
dynamic = ["version"]
classifiers = [
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"License :: OSI Approved :: BSD License",
"Topic :: Scientific/Engineering :: Visualization",
"Topic :: Multimedia :: Graphics",
"Operating System :: OS Independent",
"Framework :: Matplotlib",
]
requires-python = ">=3.7"
requires-python = ">=3.8"
dependencies = [
"numpy>=1.17,!=1.24.0",
"pandas>=0.25",
"matplotlib>=3.1,!=3.6.1",
"typing_extensions; python_version < '3.8'",
"numpy>=1.20,!=1.24.0",
"pandas>=1.2",
"matplotlib>=3.3,!=3.6.1",
]

[project.optional-dependencies]
stats = [
"scipy>=1.3",
"statsmodels>=0.10",
"scipy>=1.7",
"statsmodels>=0.12",
]
dev = [
"pytest",
Expand Down
8 changes: 3 additions & 5 deletions seaborn/_core/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
import numpy as np
import pandas as pd

from seaborn.external.version import Version

from typing import TYPE_CHECKING
if TYPE_CHECKING:
from typing import Literal
Expand Down Expand Up @@ -90,10 +88,10 @@ def variable_type(
category=(FutureWarning, DeprecationWarning) # type: ignore # mypy bug?
)
if strict_boolean:
if Version(pd.__version__) < Version("1.0.0"):
boolean_dtypes = ["bool"]
else:
if isinstance(vector.dtype, pd.core.dtypes.base.ExtensionDtype):
boolean_dtypes = ["bool", "boolean"]
else:
boolean_dtypes = ["bool"]
boolean_vector = vector.dtype in boolean_dtypes
else:
boolean_vector = bool(np.isin(vector, [0, 1, np.nan]).all())
Expand Down
4 changes: 2 additions & 2 deletions tests/_core/test_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1404,7 +1404,7 @@ def test_layout_algo(self, algo):

sep1 = bb12.corners()[0, 0] - bb11.corners()[2, 0]
sep2 = bb22.corners()[0, 0] - bb21.corners()[2, 0]
assert sep1 < sep2
assert sep1 <= sep2

def test_axis_sharing(self, long_df):

Expand Down Expand Up @@ -2056,7 +2056,7 @@ def _legend_artist(self, variables, value, scales):
labels = [t.get_text() for t in legend.get_texts()]
assert labels == names

if Version(mpl.__version__) >= Version("3.2"):
if Version(mpl.__version__) >= Version("3.4"):
contents = legend.get_children()[0]
assert len(contents.findobj(mpl.lines.Line2D)) == len(names)
assert len(contents.findobj(mpl.patches.Patch)) == len(names)
Expand Down

0 comments on commit 7b70380

Please sign in to comment.