Skip to content

DEPS: Bump optional dependencies #47048

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
May 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 23 additions & 24 deletions ci/deps/actions-38-minimum_versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,38 +20,37 @@ dependencies:
- numpy=1.18.5
- pytz=2020.1

# optional dependencies, markupsafe for jinja2
- beautifulsoup4=4.8.2
- blosc=1.20.1
- bottleneck=1.3.1
# optional dependencies
- beautifulsoup4=4.9.3
- blosc=1.21.0
- bottleneck=1.3.2
- brotlipy=0.7.0
- fastparquet=0.4.0
- fsspec=0.7.4
- fsspec=2021.05.0
- html5lib=1.1
- hypothesis=5.5.3
- gcsfs=0.6.0
- jinja2=2.11
- lxml=4.5.0
- markupsafe=2.0.1
- hypothesis=6.13.0
- gcsfs=2021.05.0
- jinja2=3.0.0
- lxml=4.6.3
- matplotlib=3.3.2
- numba=0.50.1
- numexpr=2.7.1
- numba=0.53.1
- numexpr=2.7.3
- odfpy=1.4.1
- openpyxl=3.0.3
- pandas-gbq=0.14.0
- psycopg2=2.8.4
- openpyxl=3.0.7
- pandas-gbq=0.15.0
- psycopg2=2.8.6
- pyarrow=1.0.1
- pymysql=0.10.1
- pyreadstat=1.1.0
- pymysql=1.0.2
- pyreadstat=1.1.2
- pytables=3.6.1
- python-snappy=0.6.0
- pyxlsb=1.0.6
- s3fs=0.4.0
- scipy=1.4.1
- sqlalchemy=1.4.0
- tabulate=0.8.7
- xarray=0.15.1
- pyxlsb=1.0.8
- s3fs=2021.05.0
- scipy=1.7.1
- sqlalchemy=1.4.16
- tabulate=0.8.9
- xarray=0.19.0
- xlrd=2.0.1
- xlsxwriter=1.2.2
- xlsxwriter=1.4.3
- xlwt=1.3.0
- zstandard=0.15.2
45 changes: 44 additions & 1 deletion doc/source/whatsnew/v1.5.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,50 @@ If installed, we now require:
+=================+=================+==========+=========+
| mypy (dev) | 0.950 | | X |
+-----------------+-----------------+----------+---------+

| beautifulsoup4 | 4.9.3 | | X |
+-----------------+-----------------+----------+---------+
| blosc | 1.21.0 | | X |
+-----------------+-----------------+----------+---------+
| bottleneck | 1.3.2 | | X |
+-----------------+-----------------+----------+---------+
| fsspec | 2021.05.0 | | X |
+-----------------+-----------------+----------+---------+
| hypothesis | 6.13.0 | | X |
+-----------------+-----------------+----------+---------+
| gcsfs | 2021.05.0 | | X |
+-----------------+-----------------+----------+---------+
| jinja2 | 3.0.0 | | X |
+-----------------+-----------------+----------+---------+
| lxml | 4.6.3 | | X |
+-----------------+-----------------+----------+---------+
| numba | 0.53.1 | | X |
+-----------------+-----------------+----------+---------+
| numexpr | 2.7.3 | | X |
+-----------------+-----------------+----------+---------+
| openpyxl | 3.0.7 | | X |
+-----------------+-----------------+----------+---------+
| pandas-gbq | 0.15.0 | | X |
+-----------------+-----------------+----------+---------+
| psycopg2 | 2.8.6 | | X |
+-----------------+-----------------+----------+---------+
| pymysql | 1.0.2 | | X |
+-----------------+-----------------+----------+---------+
| pyreadstat | 1.1.2 | | X |
+-----------------+-----------------+----------+---------+
| pyxlsb | 1.0.8 | | X |
+-----------------+-----------------+----------+---------+
| s3fs | 2021.05.0 | | X |
+-----------------+-----------------+----------+---------+
| scipy | 1.7.1 | | X |
+-----------------+-----------------+----------+---------+
| sqlalchemy | 1.4.16 | | X |
+-----------------+-----------------+----------+---------+
| tabulate | 0.8.9 | | X |
+-----------------+-----------------+----------+---------+
| xarray | 0.19.0 | | X |
+-----------------+-----------------+----------+---------+
| xlsxwriter | 1.4.3 | | X |
+-----------------+-----------------+----------+---------+

For `optional libraries <https://pandas.pydata.org/docs/getting_started/install.html>`_ the general recommendation is to use the latest version.
The following table lists the lowest version per library that is currently being tested throughout the development of pandas.
Expand Down
45 changes: 22 additions & 23 deletions pandas/compat/_optional.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,40 +10,39 @@
# Update install.rst when updating versions!

VERSIONS = {
"bs4": "4.8.2",
"blosc": "1.20.1",
"bottleneck": "1.3.1",
"bs4": "4.9.3",
"blosc": "1.21.0",
"bottleneck": "1.3.2",
"brotli": "0.7.0",
"fastparquet": "0.4.0",
"fsspec": "0.7.4",
"fsspec": "2021.05.0",
"html5lib": "1.1",
"hypothesis": "5.5.3",
"gcsfs": "0.6.0",
"jinja2": "2.11",
"lxml.etree": "4.5.0",
"markupsafe": "2.0.1",
"hypothesis": "6.13.0",
"gcsfs": "2021.05.0",
"jinja2": "3.0.0",
"lxml.etree": "4.6.3",
"matplotlib": "3.3.2",
"numba": "0.50.1",
"numexpr": "2.7.1",
"numba": "0.53.1",
"numexpr": "2.7.3",
"odfpy": "1.4.1",
"openpyxl": "3.0.3",
"pandas_gbq": "0.14.0",
"psycopg2": "2.8.4", # (dt dec pq3 ext lo64)
"pymysql": "0.10.1",
"openpyxl": "3.0.7",
"pandas_gbq": "0.15.0",
"psycopg2": "2.8.6", # (dt dec pq3 ext lo64)
"pymysql": "1.0.2",
"pyarrow": "1.0.1",
"pyreadstat": "1.1.0",
"pyreadstat": "1.1.2",
"pytest": "6.0",
"pyxlsb": "1.0.6",
"s3fs": "0.4.0",
"scipy": "1.4.1",
"pyxlsb": "1.0.8",
"s3fs": "2021.05.0",
"scipy": "1.7.1",
"snappy": "0.6.0",
"sqlalchemy": "1.4.0",
"sqlalchemy": "1.4.16",
"tables": "3.6.1",
"tabulate": "0.8.7",
"xarray": "0.15.1",
"tabulate": "0.8.9",
"xarray": "0.19.0",
"xlrd": "2.0.1",
"xlwt": "1.3.0",
"xlsxwriter": "1.2.2",
"xlsxwriter": "1.4.3",
"zstandard": "0.15.2",
}

Expand Down
Binary file removed pandas/tests/io/data/excel/high_surrogate.xlsx
Binary file not shown.
15 changes: 0 additions & 15 deletions pandas/tests/io/excel/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
import pytest

from pandas.compat._optional import (
get_version,
import_optional_dependency,
)

from pandas.util.version import Version

pytestmark = [
pytest.mark.filterwarnings(
# Looks like tree.getiterator is deprecated in favor of tree.iter
Expand All @@ -25,11 +18,3 @@
"ignore:.*In xlrd >= 2.0, only the xls format is supported:FutureWarning"
),
]


if import_optional_dependency("xlrd", errors="ignore") is None:
xlrd_version = None
else:
import xlrd

xlrd_version = Version(get_version(xlrd))
21 changes: 1 addition & 20 deletions pandas/tests/io/excel/test_readers.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
Series,
)
import pandas._testing as tm
from pandas.tests.io.excel import xlrd_version
from pandas.util.version import Version

read_ext_params = [".xls", ".xlsx", ".xlsm", ".xlsb", ".ods"]
engine_params = [
Expand Down Expand Up @@ -69,12 +67,7 @@ def _is_valid_engine_ext_pair(engine, read_ext: str) -> bool:
return False
if read_ext == ".xlsb" and engine != "pyxlsb":
return False
if (
engine == "xlrd"
and xlrd_version is not None
and xlrd_version >= Version("2")
and read_ext != ".xls"
):
if engine == "xlrd" and read_ext != ".xls":
return False
return True

Expand Down Expand Up @@ -1527,18 +1520,6 @@ def test_excel_read_binary_via_read_excel(self, read_ext, engine):
expected = pd.read_excel("test1" + read_ext, engine=engine)
tm.assert_frame_equal(result, expected)

@pytest.mark.skipif(
xlrd_version is not None and xlrd_version >= Version("2"),
reason="xlrd no longer supports xlsx",
)
def test_excel_high_surrogate(self):
# GH 23809
expected = DataFrame(["\udc88"], columns=["Column1"])

# should not produce a segmentation violation
actual = pd.read_excel("high_surrogate.xlsx", engine="xlrd")
tm.assert_frame_equal(expected, actual)

@pytest.mark.parametrize("filename", ["df_empty.xlsx", "df_equals.xlsx"])
def test_header_with_index_col(self, filename):
# GH 33476
Expand Down
14 changes: 1 addition & 13 deletions pandas/tests/io/excel/test_writers.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
option_context,
)
import pandas._testing as tm
from pandas.util.version import Version

from pandas.io.excel import (
ExcelFile,
Expand Down Expand Up @@ -1091,8 +1090,7 @@ def test_comment_empty_line(self, path):
result = pd.read_excel(path, comment="#")
tm.assert_frame_equal(result, expected)

def test_datetimes(self, path, request):
openpyxl = pytest.importorskip("openpyxl")
def test_datetimes(self, path):
# Test writing and reading datetimes. For issue #9139. (xref #9185)
datetimes = [
datetime(2013, 1, 13, 1, 2, 3),
Expand All @@ -1110,16 +1108,6 @@ def test_datetimes(self, path, request):

write_frame = DataFrame({"A": datetimes})
write_frame.to_excel(path, "Sheet1")
if (path.endswith("xlsx") or path.endswith("xlsm")) and Version(
openpyxl.__version__
) < Version("3.0.6"):
request.node.add_marker(
pytest.mark.xfail(
reason="Defaults to openpyxl and fails with "
"floating point error on datetimes; may be fixed on "
"newer versions of openpyxl - GH #38644"
)
)
read_frame = pd.read_excel(path, sheet_name="Sheet1", header=0)

tm.assert_series_equal(write_frame["A"], read_frame["A"])
Expand Down
26 changes: 6 additions & 20 deletions pandas/tests/io/excel/test_xlrd.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

import pandas as pd
import pandas._testing as tm
from pandas.tests.io.excel import xlrd_version
from pandas.util.version import Version

from pandas.io.excel import ExcelFile
from pandas.io.excel._base import inspect_excel_format
Expand All @@ -20,11 +18,7 @@
)


# error: Unsupported operand types for <= ("Version" and "None")
if xlrd_version >= Version("2"): # type: ignore[operator]
exts = [".xls"]
else:
exts = [".xls", ".xlsx", ".xlsm"]
exts = [".xls"]


@pytest.fixture(params=exts)
Expand Down Expand Up @@ -77,19 +71,11 @@ def test_read_excel_warning_with_xlsx_file(datapath):
path = datapath("io", "data", "excel", "test1.xlsx")
has_openpyxl = import_optional_dependency("openpyxl", errors="ignore") is not None
if not has_openpyxl:
if xlrd_version >= Version("2"):
with pytest.raises(
ValueError,
match="Your version of xlrd is ",
):
pd.read_excel(path, "Sheet1", engine=None)
else:
with tm.assert_produces_warning(
FutureWarning,
raise_on_extra_warnings=False,
match="The xlrd engine is no longer maintained",
):
pd.read_excel(path, "Sheet1", engine=None)
with pytest.raises(
ValueError,
match="Your version of xlrd is ",
):
pd.read_excel(path, "Sheet1", engine=None)
else:
with tm.assert_produces_warning(None):
pd.read_excel(path, "Sheet1", engine=None)
Expand Down
1 change: 0 additions & 1 deletion pandas/tests/io/formats/style/test_highlight.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ def test_highlight_quantile(styler, kwargs):
assert result == expected


@pytest.mark.skipif(np.__version__[:4] in ["1.16", "1.17"], reason="Numpy Issue #14831")
@pytest.mark.parametrize(
"f,kwargs",
[
Expand Down
18 changes: 1 addition & 17 deletions pandas/tests/io/test_fsspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import numpy as np
import pytest

from pandas.compat._optional import VERSIONS

from pandas import (
DataFrame,
date_range,
Expand Down Expand Up @@ -294,21 +292,7 @@ def test_stata_options(fsspectest):


@td.skip_if_no("tabulate")
def test_markdown_options(request, fsspectest):
import fsspec

# error: Library stubs not installed for "tabulate"
# (or incompatible with Python 3.8)
import tabulate # type: ignore[import]

request.node.add_marker(
pytest.mark.xfail(
fsspec.__version__ == VERSIONS["fsspec"]
and tabulate.__version__ == VERSIONS["tabulate"],
reason="Fails on the min version build",
raises=FileNotFoundError,
)
)
def test_markdown_options(fsspectest):
df = DataFrame({"a": [0]})
df.to_markdown("testmem://afile", storage_options={"test": "md_write"})
assert fsspectest.test[0] == "md_write"
Expand Down
6 changes: 1 addition & 5 deletions pandas/tests/series/methods/test_interpolate.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
isna,
)
import pandas._testing as tm
from pandas.util.version import Version


@pytest.fixture(
Expand Down Expand Up @@ -791,11 +790,8 @@ def test_interpolate_timedelta_index(self, request, interp_methods_ind):
df = pd.DataFrame([0, 1, np.nan, 3], index=ind)

method, kwargs = interp_methods_ind
import scipy

if method in {"cubic", "zero"} or (
method == "barycentric" and Version(scipy.__version__) < Version("1.5.0")
):
if method in {"cubic", "zero"}:
request.node.add_marker(
pytest.mark.xfail(
reason=f"{method} interpolation is not supported for TimedeltaIndex"
Expand Down